If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > Informix > selecting unique rows

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 01-24-05, 11:04
ahmedwaseem2000 ahmedwaseem2000 is offline
Registered User
 
Join Date: Jan 2005
Posts: 75
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
Reply With Quote
  #2 (permalink)  
Old 01-24-05, 11:41
artemka artemka is offline
Registered User
 
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
Reply With Quote
  #3 (permalink)  
Old 01-24-05, 11:50
ahmedwaseem2000 ahmedwaseem2000 is offline
Registered User
 
Join Date: Jan 2005
Posts: 75
hi it seems it is not working it is giving a syntax errors

Last edited by ahmedwaseem2000; 01-24-05 at 12:02.
Reply With Quote
  #4 (permalink)  
Old 01-24-05, 23:14
lloydnwo lloydnwo is offline
Registered User
 
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 > & <
Reply With Quote
  #5 (permalink)  
Old 01-25-05, 04:25
alinxiong alinxiong is offline
Registered User
 
Join Date: Jan 2005
Posts: 1
select col1, col2, col3 etc.,,
from tabname
group by 1,2,3 etc...
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On