Answer the question
In order to leave comments, you need to log in
How to add sorting by cell value in a column in a select query?
There is a request like
SELECT `*перечень столбцов*` FROM `table` WHERE coll='чето там' ORDER BY RAND() limit 1
SELECT `*перечень столбцов*` FROM `table` WHERE coll='чето там' ORDER BY RAND() limit 1 *не выводить где col='asd' and col='asss'*
Answer the question
In order to leave comments, you need to log in
1. For order by rand () you need to kill.
Google, the question "how to choose random values" was not discussed only by the lazy, on Habré articles the sea.
2. Just 1k lines can be perfectly sorted in php, the nuances begin when there are more lines by 1-2 orders of magnitude.
3.
WHERE coll='чето там' and not (coll = 'asd' or coll like 'asss%' )
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question