Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 3614
  • Last Modified:

How to filter empty and null values on a query ?

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
dimensionav
Asked:
dimensionav
1 Solution
 
Nathan RileyFounder/CTOCommented:
select isnull(ID_EMPLOYEE)
from table
0
 
BrandonGalderisiCommented:
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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now