RE: How to delete records after particular position ?
I believe the syntax is Delete from MyTable Where MyCriteria LIMIT HowMany. God Bless Paul C. McNeil Developer in Java, MS-SQL, MySQL, and web technologies. GOD BLESS AMERICA! To God Be The Glory! -Original Message- From: Manisha Sathe [mailto:[EMAIL PROTECTED] Sent: Monday, August 23, 2004 6:08 AM To: [EMAIL PROTECTED] Subject: How to delete records after particular position ? Hi, 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 Limit 9, 1 But i am getting erorr. pls can anybody let me know the exact syntax for this ? regards Manisha -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: How to delete records after particular position ?
if you dont want to add an auto-increment column, you can probably specify ALL columns and their values in WHERE clause and end with LIMIT 1. eg: DELETE FROM Table WHERE Column1=Value1 AND Column2=Value2 ... LIMIT 1 --- Manisha Sathe <[EMAIL PROTECTED]> wrote: > Hi, > > 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 Limit 9, 1 > > But i am getting erorr. pls can anybody let me > know the exact syntax for this ? > > regards > Manisha > > > > > > ___ Do you Yahoo!? Win 1 of 4,000 free domain names from Yahoo! Enter now. http://promotions.yahoo.com/goldrush -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: How to delete records after particular position ?
"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 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]
Re: How to delete records after particular position ?
On Monday 23 August 2004 11:08, Manisha Sathe might have typed: > Hi, > > 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 Limit 9, 1 Said record is probably keyed in some manner - either with an auto-increment field, or it will (should) have identifying characteristics. See the manual for delete syntax using matching fields. -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]