Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
anupalavila
Yak Posting Veteran
56 Posts |
Posted - 2008-12-09 : 04:56:29
|
HaiIn my customer table I have two field name and locationHow can I select name and location whose name is 'Ramu' and location is diffrent ie if the table contains values such asName locationRamu IndiaRamu USARamu India John USAJohn IndiaHow can I make a query such that it resultsRamu IndiaRamu USAThanks and Regards Anu Palavila |
|
soorajtnpki
Posting Yak Master
231 Posts |
Posted - 2008-12-09 : 06:08:28
|
hi try this select distinct name+' '+location from your_table where name='ramu' |
 |
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-12-09 : 10:56:47
|
no need of concatenating, just use select distinct name,location from your_table where name='ramu' |
 |
|
Jai Krishna
Constraint Violating Yak Guru
333 Posts |
Posted - 2008-12-13 : 07:08:49
|
You Can also try these statementsSELECT NAME,location FROM your_table WHERE NAME = 'ramu' GROUP BY name,locationSELECT NAME,location FROM your_table GROUP BY name,location HAVING name = 'ramu'Jai Krishna |
 |
|
|
|
|