July 28, 2005 at 9:40 am
how many rows do you get by doing a "select * from tempBets where matches = '4' and
mystery = '1'" ?!?!
Also you may have previous inserts in your winners table - did you check ?!
**ASCII stupid question, get a stupid ANSI !!!**
July 28, 2005 at 9:46 am
2 Records only.
I have other inserts too.
July 28, 2005 at 9:51 am
Thanks Sushila, I solved the prbs.
I forgot to add a DRAWID = @DRAWID. Thats why the extra records
Thank you so much..
July 28, 2005 at 9:56 am
as noel or remi would say - hth!
**ASCII stupid question, get a stupid ANSI !!!**
July 28, 2005 at 10:01 am
is that another vote for sushila then
Far away is close at hand in the images of elsewhere.
Anon.
July 28, 2005 at 10:06 am
oh puhleez - i wouldn't dare compete with the likes of you, noel, remi, jesper, ray m etc. for votes - you guys are superlative - i just try very hard!
ps: forgot to add...it's probably because I ate those darn chalks instead of having them thrown at me...!!!!
**ASCII stupid question, get a stupid ANSI !!!**
July 28, 2005 at 10:20 am
Don't forget modest as well
Far away is close at hand in the images of elsewhere.
Anon.
July 28, 2005 at 10:35 am
Thanks to everyone whom have helped me..
July 28, 2005 at 10:49 am
My friend needs some help. He wants his query to display records after a certain date.
@Date = '7/7/2005'
SELECT * FROM USER WHERE DATE = AFTER @DATE
Something like that, he was to display all records After this @Date. And another Query to display All records Before this particular @Date
Thanks in advance
July 28, 2005 at 11:00 am
raj - why don't you start a new thread for this ?!
is the column a datetime one ?!
ask him to try "select * from user where date >= @date"...
**ASCII stupid question, get a stupid ANSI !!!**
July 29, 2005 at 9:25 pm
Guys another query...Im working on a Stored procedure.
What I want to do, Im going to search my Winner Table, and calculate the Sum of the Winnings for Each User and Insert it into another Table.
INSERT INTO WINNER(USERID,AMOUNT)
SELECT USERID, SUM(AMOUNT) FROM TEMP_WINNER WHERE USERID = @USERID.
But the problem is, I need to specify each User's USERID. Which i do not want, I want SQL to automatically get the USERIDs and compute the Total Amount and Save it in another table.
July 29, 2005 at 10:04 pm
Raj - again not sure I understand why you want to keep the winnings separate - at any rate, you can get the total winnings per user by grouping...like so...
SELECT USERID, SUM(AMOUNT) AS TotalWinnings FROM TEMP_WINNER
GROUP BY USERID
**ASCII stupid question, get a stupid ANSI !!!**
July 29, 2005 at 10:06 pm
Oh, i didnt realise, that we can group by UserID
July 29, 2005 at 11:16 pm
IF Statement in SQL.
Im doing something like this in SQL.
SET @Share = @Share1 + @Share2
IF NOT (@Share = 0) THEN
@Amount = @Pool / @Share
ELSE
@Share = 0
END
Is my query correct in sql? Im trying to get this work, in my Stored Procedure but its not working..
July 29, 2005 at 11:36 pm
declare @Share int
declare @Share1 int
declare @Share2 int
declare @Pool int
declare @Amount int
SET @Share = @Share1 + @Share2
IF (@Share > 0)
SET @Amount = @Pool / @Share
ELSE
SET @Share = 0 ...don't really need the "else" condition since @Pool/@Share is done only when > 0
**ASCII stupid question, get a stupid ANSI !!!**
Viewing 15 posts - 61 through 75 (of 79 total)
You must be logged in to reply to this topic. Login to reply