Carl Schéle, IT, Posten wrote:
Hi!
I got a table, champions, looking like this:
idclass winner_1 winner_2 year
-
0 hd carl mattias 1957
1
: Carl Schéle, IT, Posten [mailto:[EMAIL PROTECTED]
Sent: Thursday, February 19, 2004 6:50 PM
To: [EMAIL PROTECTED]
Subject: SQL-help needed
Hi!
I got a table, champions, looking like this:
idclass winner_1
Hi!
I got a table, champions, looking like this:
idclass winner_1 winner_2 year
-
0 hd carl mattias 1957
1 hs daniel
* Dave
> Thanks for your responses but it's not that much help I need with
> my SQL ;-)
>
> None of the 3 suggestions work.
>
> Please look at the examples I gave. I need *all* UserIDs regardless of
> whether they have a record in History that matches both UserID and WeekID.
...and that is what
only exist for WeekID = 2, other for 1 and
2 and so on.
Cheers
Dave
- Original Message -
From: "Roger Baklund" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Cc: "Dave" <[EMAIL PROTECTED]>
Sent: Thursday, May 23, 2002 6:21 PM
Subject: RE: SQL
SELECT UserID, WeekID, SUM(Points) AS WeeklyPoints FROM History GROUP BY
WeekID;
Gurhan
-Original Message-
From: Dave [mailto:[EMAIL PROTECTED]]
Sent: Thursday, May 23, 2002 9:37 AM
To: [EMAIL PROTECTED]
Subject: SQL Help Needed
I have 2 tables
Users (UserID)
History (UserID
* Dave
> I have 2 tables
>
> Users (UserID)
>
> History (UserID, WeekID, Points)
>
> When a User record is created a record is inserted into History with the
> current WeekID, so for example data could be :
>
> Users
>
>
>
>
>
>
> History
> --
> - 1 - 10
>
Ok this should be easy so I'm prolly going to screw it up, but here goes =D
Your query should be:
SELECT UserID, SUM(points) FROM History WHERE WeekID = 'whatever' GROUP BY
UserIdI think that should do it. Someone yell if its wrong though.
-Nick
> I have 2 tables
>
> Users (UserID)
>
> History
I have 2 tables
Users (UserID)
History (UserID, WeekID, Points)
When a User record is created a record is inserted into History with the
current WeekID, so for example data could be :
Users
History
--
- 1 - 10
- 1 - 20
- 1 - 30
- 2 - 40