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 |
|
kamal.A
Yak Posting Veteran
70 Posts |
Posted - 2009-04-17 : 04:45:37
|
| Hi All,I have the following fields (for example) in my test table.Name adress Designation DateofbirthI have to display all the above fields in thru my query, and i will given the Designation and DateOfBirth fields. If both the fields are match the it will display all the relevant record, if any one field information is wrong then how can i identif which field is not match from sql querypls help me |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2009-04-17 : 05:02:50
|
| 1select Name, adress,Designation, Dateofbirth from your_tablewhere Designation='some value', Dateofbirth='some date'2 select Name, adress,case when Designation<>'some value' then 'not found' else Desingation end,case when Dateofbirth <>'some date' then 'not found' else Dateofbirth endfrom your_tableMadhivananFailing to plan is Planning to fail |
 |
|
|
bklr
Master Smack Fu Yak Hacker
1693 Posts |
Posted - 2009-04-17 : 06:07:29
|
quote: Originally posted by madhivanan 1select Name, adress,Designation, Dateofbirth from your_tablewhere Designation='some value', AND Dateofbirth='some date'2 select Name, adress,case when Designation<>'some value' then 'not found' else Desingation end,case when Dateofbirth <>'some date' then 'not found' else Dateofbirth endfrom your_tableMadhivananFailing to plan is Planning to fail
|
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2009-04-17 : 07:13:06
|
quote: Originally posted by bklr
quote: Originally posted by madhivanan 1select Name, adress,Designation, Dateofbirth from your_tablewhere Designation='some value', AND Dateofbirth='some date'2 select Name, adress,case when Designation<>'some value' then 'not found' else Desingation end,case when Dateofbirth <>'some date' then 'not found' else Dateofbirth endfrom your_tableMadhivananFailing to plan is Planning to fail
Thanks MadhivananFailing to plan is Planning to fail |
 |
|
|
|
|
|
|
|