Answer the question
In order to leave comments, you need to log in
How can I make such a request?
Please help me make a request!
There are four columns: X, L1, L2, L3
I would like to do the following in one query, if possible - when adding a new record,
only the value for X is specified,
which can be one of 3 possible options - L1, L2, L3,
one of them, whose name=X gets 0,
the rest +1 to the value from the previous entry...
as I understand it, triggers need to be applied here, but I can’t figure out how
Answer the question
In order to leave comments, you need to log in
"Previous entry":
SELECT * FROM tbl ORDER BY id DESC LIMIT 1 OFFSET 1
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question