Still getting to grips with sql but this seams like a pretty basic problem im obviously missing something big
SELECT * FROM myTable WHERE arbitraryInt < (SELECT MAX(arbitraryInt));
I get no rows returned when i know for a fact that there are arbitraryInt values that are less than the max. Theres no error though just nothing returned. Thanks in advance
update: this is the rest of the code which still gets an error with FROM keyword
UPDATE myTable SET arbitraryInt = arbitraryInt + 1
WHERE primaryKey = 0001 AND arbitraryInt < (
SELECT MAX(arbitraryInt) FROM myTable
);
I get the error myTable is soecified twice
The context is im trying to make items manually sortable using a sorting integer for each item. So the reason for MAX is to keep that integer from getting bigger than necessary. I'm sure theres a bette way to do this but i havent seen it. The result im looking for is a table with up and down arrows to re order list items for an online store.