MySQL Lists are EOL. Please join:

List:General Discussion« Previous MessageNext Message »
From:Egor Egorov Date:March 3 2004 4:03pm
Subject:Re: LIKE % not including NULL values?
View as plain text  
Jonas Lind?n <jonas.linden@stripped> wrote:
> SELECT * FROM testdb WHERE col1 LIKE '%'
>
> The above SELECT statement doesnt return columns with NULL values. Should it? ;).

Yes. % matches any number of characters, NULL is not character string. Use IS NULL or IS
NOT NULL operators if you want to test for NULL. 



-- 
For technical support contracts, goto https://order.mysql.com/?ref=ensita
This email is sponsored by Ensita.net http://www.ensita.net/
   __  ___     ___ ____  __
  /  |/  /_ __/ __/ __ \/ /    Egor Egorov
 / /|_/ / // /\ \/ /_/ / /__   Egor.Egorov@stripped
/_/  /_/\_, /___/\___\_\___/   MySQL AB / Ensita.net
       <___/   www.mysql.com



Thread
LIKE % not including NULL values?Jonas Lindén3 Mar
  • Re: LIKE % not including NULL values?at) domenca.si3 Mar
  • Re: LIKE % not including NULL values?Egor Egorov3 Mar
  • Re: LIKE % not including NULL values?vpendleton3 Mar
  • Re: LIKE % not including NULL values?Jonas Lindén4 Mar