Question : SQL Query

Hello ,

I have two queries getting data from two different tables:

The important columns that I need from these two queries are  the : numberOfDeposits and NumberOfWagers. I need to award each player points based of on the following:

They must have at least :

NumberOFDeposit              NumberOFWagers                          point
1 or number                             1   0r any number                         1 or any number
0                                               1   0r any number                         0
1 0r any number                       0 0r any number                           0

so in a nutshell, to get a point you must deposit and wager.  I need the SQL to get this solution from the information I have here.

Can anyone help.

Thanks
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
SELECT E.AccountId ,P.Operational 
	,FLOOR(SUM(AmountPTY)) AS Total_Amount
	,FLOOR(SUM(AmountPTY) / 250) NumberOfDeposits
	
	FROM ECos E
	
	INNER JOIN PlayerDetails P ON P.AccountId = E.PlayerId
		INNER JOIN PlayerLevel L ON L.id = P.PlayerLevelId
		
	WHERE TxnTime BETWEEN '2010-08-01 00:00:00.000' AND '2010-08-31 23:59:59.997'
	AND TxnDescriptor = 'D' 
	GROUP BY
	E.AccountId 
	,P.Operational

AND


SELECT c.AccountId, P.Operational
 ,FLOOR(SUM(BetAmtPTY)) AS Total_Amount
,FLOOR(SUM(BetAmtPTY)/250) NumberOfWagers

FROM CasinoG c
	
INNER JOIN PlayerDetails P ON P.AccountId = c.AccountId
INNER JOIN PlayerLevel L ON L.id = P.PlayerLevelId
	
WHERE C.TxnTime BETWEEN '2010-08-01 00:00:00.000' AND '2010-08-31 23:59:59.997'
AND L.LevelName = 'Pu' 
GROUP BY
c.AccountId 
,P.Operational

Answer : SQL Query

In a word, Nope.  If you use SSL and a CAPTCHA image, you've done all you need to protect your forms.  If you filter the data and escape it properly, you've done all you need to protect your data base.

best regards, ~Ray
Random Solutions  
 
programming4us programming4us