Hi,
I'm a bit stuck here.
I have a table called STM_COMM and it contains following fields: id, member_id, email_addr, tel_nr, fax_nr
A member can have multiple email addresses, telephone numbers and faxnumbers. so we could have something like this:
id member_id email_addr tel_nr fax_nr
----------------------------------------------------------------
1 5 info@test.com
2 5 555687 568774
3 66 test@go.nl 65897854
4 5 another@one.com
What I would like to have is only ONE (1) row PER member with only the FIRST (not max!) entered known data. In the above case, I'd like to have this as result:
member_id email_addr tel_nr fax_nr
----------------------------------------------------
5 info@test.com 555687 568774
66 test@go.nl 65897854
I've tried lots of things (max, inner select ...) but I can't seem to figure it out.
Thank you for the help !
Christophe
PS: I'm working on a sql server 2005