[Solved] Select from one table different values and limit them


Since you want to get 80 rows for both text and NO text, you can use UNION ALL. You can also order your data as per your requirement:

(SELECT first_column, last_column
FROM MyTable
WHERE last_column = 'text'
ORDER BY first_column
LIMIT 80)
UNION ALL
(SELECT first_column, last_column
FROM MyTable
WHERE last_column = 'NO text'
ORDER BY first_column
LIMIT 80);

See this SQLFiddle

0

solved Select from one table different values and limit them