-
Query Random Records With Sum creteria
Dear All ...
im new memmber in this great forum ..
i need help ...
i have Table like :
ID Subject Points
---- ------- --------
1 1 10
2 1 20
3 2 10
4 3 5
5 1 15
6 2 10
7 3 10
8 1 20
i need to select random records from table where Subject = 1 and Total Sum for selected records Points = 25
any one can help me ..
thanks
Last edited by dell_10; 09-07-2005 at 08:05 PM.
-
select top 25 * from tablename where subject=1 order by newid()
-
What about Sum of points ,, it should be 25 ???
25 is the sum of records points ..
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|