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 |
|
AskSQLTeam
Ask SQLTeam Question
0 Posts |
Posted - 2004-04-20 : 10:04:39
|
| Jonathan writes "I need to return the field names of an SQL table where there is one or more non null value in the field. eg.if i have :field1 field2 field31 <null> 12 <null> 23 <null> <null>then i only want to return the names of field1 and field3, which may be Title, Surname for example.Hope you can helpJonathan" |
|
|
X002548
Not Just a Number
15586 Posts |
Posted - 2004-04-20 : 12:43:57
|
| Column Names?What do you mean?Brett8-) |
 |
|
|
jsmith8858
Dr. Cross Join
7423 Posts |
Posted - 2004-04-20 : 18:57:30
|
| the quickest way might be to look at it like this:select min(city) as city, min(state) as state, min(address1) as Address1, ...from tblanywhere you see a null in a particular column in the 1 row resultset returned, you know you have null value(s) in there ...- Jeff |
 |
|
|
X002548
Not Just a Number
15586 Posts |
Posted - 2004-04-21 : 09:35:22
|
| Jeff,I'm guessing they're asking for column names....Brett8-) |
 |
|
|
|
|
|