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 |
|
tariq2
Posting Yak Master
125 Posts |
Posted - 2011-11-07 : 11:11:23
|
| Hi,Thank you in advance..I have a table with 20 columns...I need to genarate rows which fulfill the condition that any of tHE columns have a NULL.Is there a quicker way than writing the statement with 20 ORs:select * from D_Clients where ParentKey is NULL or ParentName IS NULLThank you |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2011-11-07 : 11:16:45
|
| if all are of same datatype you can useselect * from D_Clients where ParentKey + ParentName +.... IS NULL------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
 |
|
|
tariq2
Posting Yak Master
125 Posts |
Posted - 2011-11-09 : 10:29:52
|
| Thank you Visakh :) |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2011-11-09 : 11:19:37
|
| wc------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
 |
|
|
|
|
|