Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Qeury to return row where column=null 1

Status
Not open for further replies.

skurpyun

Programmer
Jun 19, 2002
60
US
I need a little help with a query statement. I am trying to return the rows of a database using a query statement where some column (called 'lasvegas') can have a value of null or an empty string (i.e. ''). This is the query statement:
select * from myTable where lasvegas <> '' or lasvegas <> null

As you can see in the latter part of that statment, i run into problems with saying 'null'.

So my question is this, how do i do a query for rows where the column value can be null in the database?

thanks in advance.
-sk
 
Hi,

Change ur SQL like this...

select * from myTable where (lasvegas <> '' or lasvegas is not null)


Sunil

 
Sunil

Fantastic. It worked like a charm. Thanks for the tip. You get a star!

-sk
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top