The database contains strings of type
"2,2,1,2" "1,2,3,1" "2,2,3,5"
How to get rows that start with the lines "2.2".
I have a feeling that your database structure is somehow not quite properly organized. But if you still have to do this sample, then probably so:
SELECT * FROM `table_name` WHERE `field_name` LIKE '2,2%'
PS If the field you have is FULLTEXT, then you can still try:
SELECT * FROM `table_name` WHERE MATCH (`field_name`) AGAINST ('2,2*' IN BOOLEAN MODE)
Source: https://ru.stackoverflow.com/questions/201700/
All Articles