distinct columns

G

Guest

The following table is an example of my table.
I need to select all columns but col1 and col2 should not have duplicates.
I also need the first line of the group.

No. col1 col2 col3 col4 col5
1 abc ttc1 789 234 235
2 abc ttc1 688 899 890
3 bdc yyr2 797 378 379
4 bdc yyr2 794 375 359
5 bdc yyr2 494 365 459
My results should be:

abc ttc1 789 234 235
bdc yyr2 797 378 379

How do I get col1 and col2 to be unique.
 
G

Guest

Another example:

No. col1 col2 col3 col4 col5 col6
1 abc ttc1 789 234 235 12/4/2004
2 abc ttc1 688 899 890 11/23/2003
3 bdc yyr2 797 378 379 12/1/2004
4 bdc yyr2 794 375 359 12/8/2004
5 bdc yyr2 494 365 459 11/08/2004

I need col1 and col2 to be distinct and the results should return the most
recent date information.

For example the results should pull back
abc ttc1 789 234 235 12/4/2004
bdc yyr2 794 375 359 12/8/2004
 
Ô

ôë

stw8 said:
Another example:

No. col1 col2 col3 col4 col5 col6
1 abc ttc1 789 234 235 12/4/2004
2 abc ttc1 688 899 890 11/23/2003
3 bdc yyr2 797 378 379 12/1/2004
4 bdc yyr2 794 375 359 12/8/2004
5 bdc yyr2 494 365 459 11/08/2004

I need col1 and col2 to be distinct and the results should return the most
recent date information.

For example the results should pull back
abc ttc1 789 234 235 12/4/2004
bdc yyr2 794 375 359 12/8/2004
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top