Re: Why can't I delete these records?

2006-08-28 Thread Evert Meulie
Hi all! I got it to work! :-) And all I did was replacing IS NULL with = '-00-00 00:00:00' in the DELETE-statement... Does anyone have an explanation for this...? Regards, Evert Michael Stassen wrote: Evert wrote: Hi all! Who can tell me why the following does not work...? When

Re: Why can't I delete these records?

2006-08-28 Thread Joerg Bruehe
Hi Evert, all! Evert Meulie wrote (re-ordered): Michael Stassen wrote: Evert wrote: Hi all! Who can tell me why the following does not work...? When I do: SELECT COUNT(*) AS counter FROM table1 WHERE condition1 = 'A' AND condition2 IS NULL; it returns: +-+ | counter | +-+

Re: Why can't I delete these records?

2006-08-28 Thread Evert Meulie
I'll double-check it on another MySQL server I have here (uses same version of MySQL) and will file a bug report if I indeed can replicate the problem. Thank you all for the swift replies! :-) Regards, Evert Joerg Bruehe wrote: Hi Evert, all! Evert Meulie wrote (re-ordered): Michael

Re: Why can't I delete these records?

2006-08-27 Thread Michael Stassen
Evert wrote: Hi all! Who can tell me why the following does not work...? When I do: SELECT COUNT(*) AS counter FROM table1 WHERE condition1 = 'A' AND condition2 IS NULL; it returns: +-+ | counter | +-+ | 2 | +-+ Then I do: DELETE FROM table1 WHERE

Re: Why can't I delete these records?

2006-08-26 Thread Aleksandar Bradaric
Hi, Query OK, 0 rows affected (0.00 sec) It did not find/delete any rows - please double-check your conditions and make sure you are using the same set as for the SELECT statement. Best regards, Aleksandar -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To

Re: Why can't I delete these records?

2006-08-26 Thread Evert
Hi! I'm entering the statements exactly as listed in my message (only done a search/replace on table-name). So SELECT says there are 2 records, but then DELETE does not see those same 2 records... :-/ Is there something like a verbose/debug mode in which I can see more precise why my

Re: Why can't I delete these records?

2006-08-26 Thread Rocco
Hello Evert, i just entered your example and had no unusal behaviour on MySQL 5.0: mysql describe table1; +++--+-+-+---+ | Field | Type | Null | Key | Default | Extra | +++--+-+-+---+ |

Re: Why can't I delete these records?

2006-08-26 Thread Evert
I'm using MySQL 4.1.21 (on Gentoo). Should this make any difference? Regards, Evert Rocco wrote: Hello Evert, i just entered your example and had no unusal behaviour on MySQL 5.0: mysql describe table1; +++--+-+-+---+ | Field | Type

Re: Why can't I delete these records?

2006-08-26 Thread Rocco
Hello Evert, i actually do not know and don't have access to a 4.1 Machine. What you could try is to use the alternative way of testing if a value is NULL: Maybe the behavior of IS NULL has been changed in 5.0 . DELETE FROM table1 WHERE condition1='A' AND condition2=NULL Greets Rocco Evert

Re: Why can't I delete these records?

2006-08-26 Thread Evert
Hi! I tried your tip, but = gives the same result as = when I execute the query... :-/ Regards, Evert Rocco wrote: Hello Evert, i actually do not know and don't have access to a 4.1 Machine. What you could try is to use the alternative way of testing if a value is NULL: Maybe the

Re: Why can't I delete these records?

2006-08-26 Thread Rocco
Hello Evert, the = Operator can not work with NULL values , so you have to use = or IS NULL. I have no clue why its not working at your side, but i assure you that it must be a rather simply problem (typo, table definition). Are you sure your definition2-column allows NULL values in the first

Re: Why can't I delete these records?

2006-08-26 Thread Evert
Oops, that was just a typo in my previous reply. My script does use 'IS NULL' and not '= NULL'. I also tried '= NULL'. No luck... Evert Rocco wrote: Hello Evert, the = Operator can not work with NULL values , so you have to use = or IS NULL. I have no clue why its not working at your