Here is a nice statement to generate sql to do an update.
Here is a nice statement to generate sql to do an update.
Note the use of the triple single quotes to do this. Another way is to do a select into, but often companies want to have a script that is repeatable, and this generates such a script. You run it, and in toad save the results in a text file.
SELECT 'UPDATE COOKIE_TABLE SET cookiecost = ''' || cost || ''' WHERE userid = ' || userid || ';'
FROM cookie_table WHERE category = 'sugar cookies'
Note the use of the triple single quotes to do this. Another way is to do a select into, but often companies want to have a script that is repeatable, and this generates such a script. You run it, and in toad save the results in a text file.
0 Comments:
Post a Comment
<< Home