I want to return the previous row based on the current id number.
All id numbers are UNIQUE, but are NOT (necessarily) SEQUENTIAL.
"SELECT LAG(id) FROM cb_cat WHERE id=450";
I thought this query should work.
If possible, I would like to return * from the previous row before the current id.
I do not know which id number that is, but it is smaller than the current id number, e.g. 450. It could be 449 or even 1.
How can I achieve this?
Thank you for your help.