Page 1 of 1
How do I say this:
Posted: Wed Jun 13, 2012 7:44 am
by wvoyance
If I delete one record the SQL is
DELETE FROM `products_description` WHERE `products_description`.`products_id` = 1213 AND `products_description`.`language_id` = 1 LIMIT 1
If I want to delete from products_id =1000 to 1213
irrespect of other field how do I say it?
Re: How do I say this:
Posted: Wed Jun 13, 2012 8:03 am
by Celauran
Code: Select all
DELETE FROM products_description
WHERE product_id >= 1000 AND product_id <= 1213
Code: Select all
DELETE FROM products_description
WHERE product_id BETWEEN 1000 AND 1213
Re: How do I say this:
Posted: Wed Jun 13, 2012 8:23 am
by wvoyance
do i need a quotation mark for 'products_description' etc?
Re: How do I say this:
Posted: Wed Jun 13, 2012 8:46 am
by social_experiment
wvoyance wrote:do i need a quotation mark for 'products_description' etc?
For the values you can use single quotes (') and for table fields, table names you can encase them in backticks (`)
Re: How do I say this:
Posted: Wed Jun 13, 2012 9:43 am
by wvoyance
do i have to use quote? It seems no quote also work fine.
Re: How do I say this:
Posted: Wed Jun 13, 2012 9:48 am
by Celauran
Given that the values are numerical, you don't need quotes. Putting backticks around table and field names is good practice, though.