"Manisha Sathe" <[EMAIL PROTECTED]> wrote on 23/08/2004 11:08:10:

> Here i am again. I can select particular record by using 
> 
> LIMIT 9,1
> 
> But e.g. if i want to delete this record  then how shall i do ? I 
> tried to use 
> 
> Delete from <table name>  Limit 9, 1
> 
> But i am getting erorr. pls can anybody let me know the exact syntaxfor 
this ?

MySQL does not allow this because it is, in the general case, extremely 
dangerous. Suppose someone else had added or selected records from the 
table between your SELECT and DELETE? You would then delete a different 
record to the one you intended to. 

Generally you can only delete using a WHERE clause so that you are sure 
that you are accessing the column you intend. The easiest way of doing 
this, if you have no other obvious way of doing it, is to an 
AUTO_INCREMENT column to your table, which will give each row a unique 
reference number. You can then deleted the row having that reference 
number knowing you will deleted the right record regardless of what else 
may be occurring.

        Alec



-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to