Results 1 to 5 of 5
  1. #1
    Join Date
    Jan 2005
    Posts
    80

    Unanswered: selecting unique rows

    Hi, there are around 10 columns which has got duplicate rows so could any one of you please help me retriving unique rows. rows that are unique for all the 10 columns.

    Thanks in advance

    Cheers,
    Waseem

  2. #2
    Join Date
    May 2004
    Location
    New York
    Posts
    248
    try something like,
    select count(*), col1, col2, col3 etc.,,
    from tabname
    group by 2,3,4 etc...
    order by 1 desc

  3. #3
    Join Date
    Jan 2005
    Posts
    80
    hi it seems it is not working it is giving a syntax errors
    Last edited by ahmedwaseem2000; 01-24-05 at 13:02.

  4. #4
    Join Date
    Aug 2003
    Location
    India
    Posts
    262
    Try this -

    select count(*), no, name
    from test
    group by 2,3
    having count(*)=1

    you can subsitute the = clause with > & <

  5. #5
    Join Date
    Jan 2005
    Posts
    1
    select col1, col2, col3 etc.,,
    from tabname
    group by 1,2,3 etc...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •