That syntax will always report zero rows affected, but it is very fast. If you want to know how many rows were deleted, use something like "DELETE * FROM Sqs WHERE 1=1".
The latter query will be much slower, as it examines each record. Nick > -----Original Message----- > From: Bhavin Vyas [mailto:[EMAIL PROTECTED]] > Sent: Monday, July 15, 2002 9:40 AM > To: [EMAIL PROTECTED] > Subject: Interesting > > > I did a select * as such: > > mysql> select * from Sqs; > +-------------+---------+--------+ > | RecordState | Sqs | SqsKey | > +-------------+---------+--------+ > | L | unknown | 1 | > +-------------+---------+--------+ > 1 row in set (0.00 sec) > > Then, look at the message that delete from gives me '0 rows affected' > mysql> delete from Sqs; > Query OK, 0 rows affected (0.02 sec) > > However, it did indeed delete one row, since now I get an empty set when I > do a select *. > > mysql> select * from Sqs; > Empty set (0.00 sec) > > Anybody knows why, then, delete gave me a '0 rows affected' > message instead > of saying '1 row affected'? > > Mysql version 3.23.49 > > Regards, > Bhavin. > > > > --------------------------------------------------------------------- > Before posting, please check: > http://www.mysql.com/manual.php (the manual) > http://lists.mysql.com/ (the list archive) > > To request this thread, e-mail <[EMAIL PROTECTED]> > To unsubscribe, e-mail > <[EMAIL PROTECTED]> > Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php --------------------------------------------------------------------- Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail <[EMAIL PROTECTED]> To unsubscribe, e-mail <[EMAIL PROTECTED]> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php