I want to get the first and the last row from a table. Once i get that, i want to get another first and last row from another table.
Is some strange i think, but this is it.
please, maybe somebody can give me an advice for what i want.
This is where i'm stuck :
Try using this:-
SELECT column name
FROM table1
WHERE <conditions>
ORDER BY date DESC
LIMIT 1
UNION
SELECT column name
FROM table1
WHERE <conditions>
ORDER BY date ASC
LIMIT 1
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.