sql - MYSQL nested query newbie question -
i trying increment 'sellingdate' field that's in 'company' table.
update company set sellingdate = ((select date_add((select sellingdate company cid = '35'), interval 1 day))) cid = '35';
this query gives me error saying:
error code: 1093
can't specify target table 'company' update in clause
what doing wrong here?
use:
update company set sellingdate = date_add(sellingdate, interval 1 day) cid = '35'
mysql doesn't allow subquery in update statement against same table, subquery unnecessary example. odd reason self-join in update statement won't return 1093 error though it's same logic.
Comments
Post a Comment