0

Table name = Contacts.
Table attributes = first_name,last_name,email_address,other_email,address,phone,notes.

I want to retrieve without repetition(DISTINCT) first_name and address. But, when retrieving these 2 data, i want all the other data(notes,last_name,etc..) associated to this the DISTINCT data to show.

Is there any SQL data for this kind of situation?

2
Contributors
4
Replies
5
Views
6 Years
Discussion Span
Last Post by huangzhi
0

For eg, my database table is this.

First_name Last_name TelphoneNo Email_addr HomeAddr
Abu Thahir 90338833 thahir@hotmail.com Blk 143, hil ave..
Abu Thahir 90338833 thahir@hotmail.com Blk 143, hil ave..
Syed Thahir 90848443 thakjdr@hotmail.com Blk 143, hil ave..
Syed Thahir 90843877 thjhfir@hotmail.com Blk 143, hil ave..

I want to use SQL to Select All DISTINCT First_name and E-mail. While, all my Distinct results comes out, i want my address,telphoneNo,last_Name to come out too.

Is it possible to achive it???

0

For eg, my database table is this.

First_name, Last_name, TelphoneNo, Email_addr, HomeAddr
Abu Thahir 90338833 thahir@hotmail.com Blk 143, hil ave..
Abu Thahir 90338833 thahir@hotmail.com Blk 143, hil ave..
Syed Thahir 90848443 thakjdr@hotmail.com Blk 143, hil ave..
Syed Thahir 90843877 thjhfir@hotmail.com Blk 143, hil ave..

I want to use SQL to Select All DISTINCT First_name and E-mail. While, all my Distinct results comes out, i want my address,telphoneNo,last_Name to come out too.

Is it possible to achive it??? thahir
Reputation Points: 10
Solved Threads: 0Newbie Poster
Online
2 posts
since Nov 2009
Flag Bad Post Edit Post Reply

0

I think you cannot use DISTINCT. But you can use GROUP BY command because you want to display Address, telphoneNo and last_Name. And you must determine which row will be displayed if there are more than 1 double row in First_Name and E-Mail.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.