select top n unique records from table

  • table

    ---------------------

    id,category,record

    1,love,my record title

    2,love,my record title 2

    3,fun,my record title 3

    4,sports,my record title 4

    5,sports,my record title 5

    6,fun,my record title 6

    7,love,my record title 7

    8,sport,my record title 8

    9,sport,my record title 8

    i am trying to select top 5 unique records from this table.

    table has 4 sport, 3 love and 2 fun category

    so when query runs it would only select one of each category from top

    ten records ordered by id

    can anyone give me some help?

  • Hi Pols,

    Similar issue you post in the SQL Server 7,2000 » General » select to 2 resords for each record

    Link : http://www.sqlservercentral.com/Forums/Topic699943-9-1.aspx

    Same coding for this also, try that one…..

    ARUN SAS

    😀

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply