It's not possible for a column value to be equal to NULL; hence the SQL
syntax is 'IS NULL'. However, in an UPDATE statement, writing
'columnA=NULL' is valid, as in this context '=' is an assignment, not a
relationship operator.

Regards.

rayB



|---------+---------------------------->
|         |           Tito Ciuro       |
|         |           <[EMAIL PROTECTED]> |
|         |                            |
|         |           28/10/2004 08:55 |
|         |           AM               |
|         |           Please respond to|
|         |           sqlite-users     |
|         |                            |
|---------+---------------------------->
  
>------------------------------------------------------------------------------------------------------------------------------|
  |                                                                                    
                                          |
  |       To:       Forum SQLite <[EMAIL PROTECTED]>                                   
                                    |
  |       cc:                                                                          
                                          |
  |       Subject:  [sqlite] How are NULL values deleted?                              
                                          |
  
>------------------------------------------------------------------------------------------------------------------------------|




Hello,

I'd like to remove all rows with a specific column equaling NULL. I've
tried this:

SQLite version 3.0.8
Enter ".help" for instructions
sqlite> select * from address;
Ciurķ|1|Javi||Espaņa
Garaicoechevarria|2|Ana||Espaņa
Ciurķ|3|Tito||Espaņa
Miti|4|Sam||Italy
Schmuck|5|Joe||Germany
sqlite> delete from address where ZIP = NULL;

sqlite> select * from address;
Ciurķ|1|Javi||Espaņa
Garaicoechevarria|2|Ana||Espaņa
Ciurķ|3|Tito||Espaņa
Miti|4|Sam||Italy
Schmuck|5|Joe||Germany

sqlite> delete from address where ZIP = 'NULL';
sqlite> select * from address;
Ciurķ|1|Javi||Espaņa
Garaicoechevarria|2|Ana||Espaņa
Ciurķ|3|Tito||Espaņa
Miti|4|Sam||Italy
Schmuck|5|Joe||Germany

Since all rows have NULL for ZIP, I would expect to remove all rows,
but I cannot figure it out...

Any ideas?

Thanks,

-- Tito







******************* Confidentiality and Privilege Notice *******************

This e-mail is intended only to be read or used by the addressee. It is
confidential and may contain legally privileged information. If you are not
the addressee indicated in this message (or responsible for delivery of the
message to such person), you may not copy or deliver this message to anyone,
and you should destroy this message and kindly notify the sender by reply
e-mail. Confidentiality and legal privilege are not waived or lost by reason
of mistaken delivery to you.

Qantas Airways Limited
ABN 16 009 661 901

Visit Qantas online at http://qantas.com

****************************************************************************

Reply via email to