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 |
SQLBoy14
Yak Posting Veteran
70 Posts |
Posted - 2014-08-12 : 23:17:17
|
Hello,How do I query CASE for data that has Null and Not Null. Here is my simple query:Select HomeAddressFrom RealEstateoutput: (5 records)Null20 Park StreetNullNullNullHow do I write CASE Statement, if Null then 'Empty' and if its NOT NUll then 'Not Empty' ?Anyone can help? |
|
stepson
Aged Yak Warrior
545 Posts |
Posted - 2014-08-13 : 00:47:00
|
[code]Select HomeAddress ,CASE WHEN HomeAddress IS NULL THEN 'Empty' ELSE 'Not Empty' END AS caseStmt From RealEstate[/code]sabinWeb MCP |
|
|
SQLBoy14
Yak Posting Veteran
70 Posts |
Posted - 2014-08-13 : 23:45:18
|
Thank you Stepson.It worked.SQLBoy |
|
|
|
|
|