select distinct id with other data

  • Thread starter Thread starter Mario Krsnic
  • Start date Start date
M

Mario Krsnic

Hello everybody,
I have a table with such data:
id name
1 Mario
1 Mario Krsnic
1 MKrsnic
1 MarioK
The same Id refers to different names of the same person.
how can I select distinct ID with both columns? If I use select distinct
id,name then I get the above data. I would like to have only:
1,Mario(or some other variante of the name)
In the result should every id appear only once.
Thanks for suggestions!
Mario
 
Mario said:
I have a table with such data:
id name
1 Mario
1 Mario Krsnic
1 MKrsnic
1 MarioK
The same Id refers to different names of the same person.
how can I select distinct ID with both columns? If I use select distinct
id,name then I get the above data. I would like to have only:
1,Mario(or some other variante of the name)
In the result should every id appear only once.


Try using this kind of query:

SELECT ID, First([Name[)
FROM [the table]
GROUP BY ID
 

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

Similar Threads


Back
Top