+ 2

Select rows with specific text in their column

i want to select rows which have a specific text in one of the row's column. for example in table below: id. name. achieves. ____________________ 0. Alex. "a1,a2,a3" 1. Pitter. "a2" 2. John. "a1,a3" 3. Ronny. "a2,a3" ... ... ... **achieves column accept Text** how to select rows which their achieves column contain for example a1 and a2 achievements. also the method should be fast as enough to do this in a very short time tnx for answering

6th Dec 2017, 3:36 PM
Mehdi
Mehdi - avatar
1 Antwort
+ 7
There must be some more efficient ways, but right now this one has come in my mind: SELECT * FROM table_name where achieves LIKE '%a1%' OR achieves LIKE '%a2%';
6th Dec 2017, 4:09 PM
Shamima Yasmin
Shamima Yasmin - avatar