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 Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Identify Dups 1

Status
Not open for further replies.

see123

Programmer
Joined
May 11, 2001
Messages
28
Location
US
I have a data that looks like this

ID Name Addr
1 John
2 John 1234 data way
3 John 1234 Data Way
4 Peter
5 Peter 3456 P street
6 Peter 3456 P Street

How can I display the above data

1 John 1234 data Way
4 Peter 3456 P Street

Thanks in Advance.....
 
Code:
SELECT MIN(id)    AS id
     , Name
     , MAX(Addr)  AS Addr
  FROM daTable
GROUP
    BY Name
:-)

r937.com | rudy.ca
 
Hi Rudy thanks for your help.

Is there a way I can display ID number where Addr field is null. In my first example it worked by using Min function.
in some cases ID no is different.

Here is the sample data.

ID Name Addr
1 John
2 John 1234 data way
3 John 1234 Data Way
4 Peter
5 Peter 3456 P street
6 Peter 3456 P Street
7 smith x street
8 Smith
9 Smith Q street

I want to display the data like this

1 John 1234 data Way
4 Peter 3456 P Street
8 Smith Q Street





 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top