sql - How update order -
this table:
id int (primary key) name order
i'm trying move up/down rows. want update order field.
update technology set order = order + 1 id = 2;
i'm guessing have problem column name order
. order
keyword can't use directly. try way:
update technology set [order]=[order]+1 id=2
try this:
update menu set [order]=m2.[order]+1 menu join menu m2 on menu.[order]= m2.[order]-1
Comments
Post a Comment