Answer the question
In order to leave comments, you need to log in
How to generate mySQL query?
There is a table of orders with fields
date
status
client id
, you need to select all records with status 0 whose date is less than the date of the last successful client order (status 1)
Answer the question
In order to leave comments, you need to log in
SELECT * FROM table WHERE client_id = id AND status = 0 AND date < (SELECT date FROM table WHERE client_id = id AND status = 1 ORDER BY date LIMIT 1) - something like that, I think.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question