I know this is a pretty simple question, but I'm a rookie at SQL.
I have a column named 'rowOrder' in my table. When a user enters a new item/row into the table, I want SQL to get the highest number in 'rowOrder'column, and add 1, and set that new 'rowOrder' field to that number.
Can someone show me the SQL language that will accomplish this ?
I tried something similar to
but no luck.
Am i on the right track ?
Thanks very much !!
I have a column named 'rowOrder' in my table. When a user enters a new item/row into the table, I want SQL to get the highest number in 'rowOrder'column, and add 1, and set that new 'rowOrder' field to that number.
Can someone show me the SQL language that will accomplish this ?
I tried something similar to
Code:
INSERT INTO mytable(rowOrder) VALUES MAX(rowOrder) + 1
Am i on the right track ?
Thanks very much !!