Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

SQL Null values

Posted on 2011-03-23
6
Medium Priority
?
213 Views
Last Modified: 2012-05-11
when i try the following query it does not work.
CASE WHEN Resource.EmployedBy = NULL THEN 'UNKNOWN' ELSE Resource.EmployedBy END AS EmployedBy,

or

CASE WHEN Resource.EmployedBy  ISNULL THEN 'UNKNOWN' ELSE Resource.EmployedBy END AS EmployedBy,
0
Comment
Question by:aneilg
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 Comments
 
LVL 18

Accepted Solution

by:
Cluskitt earned 256 total points
ID: 35197677
CASE WHEN Resource.EmployedBy  IS NULL THEN 'UNKNOWN' ELSE Resource.EmployedBy END AS EmployedBy,


You have to separate IS and NULL
0
 
LVL 143

Assisted Solution

by:Guy Hengel [angelIII / a3]
Guy Hengel [angelIII / a3] earned 248 total points
ID: 35197711
IS NULL  should do
0
 
LVL 24

Assisted Solution

by:jimyX
jimyX earned 248 total points
ID: 35197724
You can use IsNull:
ISNULL(Resource.EmployedBy, 'UNKNOWN')
0
 
LVL 41

Assisted Solution

by:Sharath
Sharath earned 248 total points
ID: 35199709
ISNULL or COALESCE would be sufficient here.

COALESCE(Resource.EmployedBy, 'UNKNOWN')
0
 
LVL 71

Expert Comment

by:Qlemo
ID: 36032415
This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you find yourself in this situation “I have used SELECT DISTINCT but I’m getting duplicates” then I'm sorry to say you are using the wrong SQL technique as it only does one thing which is: produces whole rows that are unique. If the results you a…
Confronted with some SQL you don't know can be a daunting task. It can be even more daunting if that SQL carries some of the old secret codes used in the Ye Olde query syntax, such as: (+)     as used in Oracle;     *=     =*    as used in Sybase …
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…
Suggested Courses

610 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question