Solved

How to filter empty and null values on a query ?

Posted on 2009-04-01
2
3,601 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
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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

PL/SQL can be a very powerful tool for working directly with database tables. Being able to loop will allow you to perform more complex operations, but can be a little tricky to write correctly. This article will provide examples of basic loops alon…
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.
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

746 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now