I have a database with some products in it. I can update one of the
products with a SQL query by the command
In order for me to update about 100 products to a price '3.99' I have to
go in excel and do some concatenations( linking) and then copy and paste a hundred
individual command lines of
Is there a command where I can just type one line such as
Do I need to use the WHERE Command?
I am new to MySQL but really want to learn it becaue manipulating it in
excel is taking a long time. Anything would help.
Thanks
products with a SQL query by the command
Code:
UPDATE `mytablename` SET `price` = '7.99' WHERE `id` =26 LIMIT 1 ;
In order for me to update about 100 products to a price '3.99' I have to
go in excel and do some concatenations( linking) and then copy and paste a hundred
individual command lines of
Code:
UPDATE `mytablename` SET `price` = '3.99' WHERE `id` =26 LIMIT 1 ; UPDATE `mytablename` SET `price` = '3.99' WHERE `id` =27 LIMIT 1 ; UPDATE `mytablename` SET `price` = '3.99' WHERE `id` =28 LIMIT 1 ; UPDATE `mytablename` SET `price` = '3.99' WHERE `id` =29 LIMIT 1 ; UPDATE `mytablename` SET `price` = '3.99' WHERE `id` =30 LIMIT 1 ; UPDATE `mytablename` SET `price` = '3.99' WHERE `id` =100 LIMIT 1 ;
Code:
UPDATE `mytablename` SET `price` = '3.99' WHERE `id` =26-100 LIMIT 1 ;
I am new to MySQL but really want to learn it becaue manipulating it in
excel is taking a long time. Anything would help.
Thanks
Comment