Solved

How to filter empty and null values on a query ?

Posted on 2009-04-01
2
3,606 Views
Last Modified: 2012-05-06
HI
I need to perform a query comparing a field agaist NULL and empty values, something like:

if ID_EMPLOYEE is not NULL or is NOT empty then....

How to do that ?

Thanks in advance
0
Comment
Question by:dimensionav
[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
2 Comments
 
LVL 11

Expert Comment

by:N R
ID: 24041799
select isnull(ID_EMPLOYEE)
from table
0
 
LVL 39

Accepted Solution

by:
BrandonGalderisi earned 500 total points
ID: 24041927
What DB Engine?

SQL Server:

select *from SomeTable
where nullif(id_employee,'') <> ''

or

select *from SomeTable
where id_employee is not null
and len(id_employee)>0
0

Featured Post

Resolve Critical IT Incidents Fast

If your data, services or processes become compromised, your organization can suffer damage in just minutes and how fast you communicate during a major IT incident is everything. Learn how to immediately identify incidents & best practices to resolve them quickly and effectively.

Question has a verified solution.

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

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 …
This article describes how to use the timestamp of existing data in a database to allow Tableau to calculate the prior work day instead of relying on case statements or if statements to calculate the days of the week.
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …

751 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