LIKE '%' doesn't take into account NULL values

geo__

Registered User.
Local time
Today, 07:12
Joined
Nov 28, 2003
Messages
13
Hi all,
I have a select statement liek this one:

Select * from table1 where lastname LIKE 'var1%' and firstname LIKE 'var2%' and address LIKE '%'

My problem is that the select will not return those records where address is null!

Is there any way to overcome this without converting all the NULL values to something else?

Thanks,
George
 
SELECT *
FROM table1
WHERE lastname LIKE 'var1*'
AND firstname LIKE 'var2*'
AND (address LIKE '*'
OR address Is Null);[/B][/QUOTE]
 

Users who are viewing this thread

Back
Top Bottom