update cds set numberinstock=numberinstock+3 order by cdname asc
i am using above update command in oracle but it is giving error SQL command not properly ended.
You cannot combine an UPDATE statement with an ORDER BY clause. Update changes the records in a table, ORDER BY is usually used to order the records in a query set (e.g. after a SELECT statement) but not in the DB table itself.
What do you wish to achieve by using ORDER BY in this statement? Consider doing this instead:
UPDATE cds SET numberinstock = numberinstock + 3;
SELECT * FROM cds ORDER BY cdname asc
order byin anupdatestatement does not make sense. What are you trying to achieve?