| Author |
Topic  |
|
|
jayanth_jyothi
Starting Member
Japan
11 Posts |
Posted - 10/06/2005 : 00:22:09
|
Customer table having custid,cust_name,homephone,workphone fields.. in that table there is same phone numbers for two or three customers.. i want distinct homephoneno,workphone from that table and only one customer... please give me the query |
|
|
madhivanan
Premature Yak Congratulator
India
22461 Posts |
Posted - 10/06/2005 : 00:29:34
|
Try this
Select Customer,homephoneno,workphone from Customer C where homephoneno=(Select top 1 homephoneno from Customer where custid=C.custid)
Otherwise post some sample data and the result you want
Madhivanan
Failing to plan is Planning to fail |
Edited by - madhivanan on 10/06/2005 00:31:09 |
 |
|
|
jayanth_jyothi
Starting Member
Japan
11 Posts |
Posted - 10/06/2005 : 04:59:51
|
Thank u madhivanan for sending.. but its not comming.. now i am sending the data
cust_id cust_lname cust_homephone cust_workphone 12717 Rajkumar 01303223294 07986382816
12037 Mayank Gohil 01303223294 01303224513
28413 dsdsds 02073606070 01158467685
11724 speddireddi 02073606077 02073606077
22964 satya 02414120406 02414126859
38271 ravishanker siddamsetty 07618812588 01797381667
13160 Mr B.K Jasti 02088887949 02088887949
11858 chilakapati rajeev 02088887949 02088887949
11866 kadiyala vinay kumar 02088887949 02088887949
13160 Mr B.K Jasti 02088887949 02088887949
in that Rajkumar,Mayank Gohil have same phone numbers.. but i want only rajkumar reord |
 |
|
|
madhivanan
Premature Yak Congratulator
India
22461 Posts |
Posted - 10/06/2005 : 05:16:45
|
Try this
Select cust_id,cust_lname,cust_homephone,cust_workphone from Customer C where cust_id=(Select top 1 cust_id from Customer where cust_homephone=C.cust_homephone)
Madhivanan
Failing to plan is Planning to fail |
 |
|
| |
Topic  |
|