I've made a new tuple called 'description' in a table.
Just want a query to set all the 'description' tuples for my already created data to a certain piece of text.
E.g. of fundamental 'update' query, but not sure if it is not the right method to use:
UPDATE suppliers SET name = 'HP'WHERE name = 'IBM';
Any suggestions?
The formatting of the query you've provided is correct. Before running an UPDATE
or DELETE
it's always wise to run a SELECT
of that query to make sure that is the change you want to make.
Your test query would be:
SELECT name FROM suppliers WHERE name = 'IBM';
However, the query you've provided will not update the description
column. To do this, you would need something like:
UPDATE suppliers SET description = 'HP' WHERE name = 'IBM';
After executing this UPDATE
, you can run this query to validate your result:
SELECT name, description FROM suppliers WHERE name = 'IBM';
Sorted
I Just used:
UPDATE suppliers SET description = 'business'
This setS all the description FIELDS in my table to the string "business".
Thanks for the suggestions.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With