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 |
|
tskmjk
Starting Member
11 Posts |
Posted - 2010-02-10 : 04:26:23
|
| This is the strange request but I got this requirement from Operations department where the table structure is as follows:Sno customername custno mobileno landlineno alterphno .....----------------------------------------------------------Customer through Inbound call provides a phone number which can be anything..so I would like to retrieve column name by this phone number for example..customer provides '1234576' as the phone number, I wouldnt know under which column this number resides, so I would like to know..Kindly help me on this... |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2010-02-10 : 04:33:54
|
[code]select column_name = 'mobileno'from tablewhere mobileno = '1234567'union allselect column_name = 'landlineno'from tablewhere landlineno = '1234567'union allselect column_name = 'alterphno'from tablewhere alterphno = '1234567'. . . [/code] KH[spoiler]Time is always against us[/spoiler] |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
|
|
tskmjk
Starting Member
11 Posts |
Posted - 2010-02-10 : 04:56:08
|
| Thanks buddy |
 |
|
|
|
|
|