Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

more than distinct 1

Status
Not open for further replies.

MrDontKnowNothing

Programmer
Jun 26, 2003
94
0
0
DE
hi folks,

when using a distinct on a table, i only get the data one time. that's fine but in the following example it's a little inappropriate...

having a table like this:

id | email
----------------
1 | a@b.com
2 | b@b.com
2 | c@b.com
3 | d@b.com
4 | e@b.com
4 | f@b.com

i want a select stmt wich only returns something like this

id | email
----------------
1 | a@b.com
2 | b@b.com
3 | d@b.com
4 | e@b.com

many thanks in advance!

alex
 
Try:
Code:
SELECT ID, MIN(email) from mytable ;
  GROUP BY ID ;
  ORDER BY ID ;
 INTO CURSOR curRESULT
Rick

 
Star bright Rick!

Slighthaze = NULL
[sub]craig1442@mchsi.com[/sub][sup]
"Whom computers would destroy, they must first drive mad." - Anon​
[/sup]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top