Results 1 to 3 of 3

Thread: Query Random Records With Sum creteria

  1. #1
    Join Date
    Sep 2005
    Posts
    6

    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.

  2. #2
    Join Date
    Sep 2002
    Location
    Fantasy
    Posts
    4,254
    select top 25 * from tablename where subject=1 order by newid()

  3. #3
    Join Date
    Sep 2005
    Posts
    6
    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
  •