Forum Moderators: coopster
You are specifying a count of 1 which means that all this would return is 0
Try simply using SUBSTRING as you don`t need a delimiter:
select id from table where SUBSTRING('0.3 MP camera', 0, 3) = '0.3'
For more info see the following:
[dev.mysql.com...]
dc
LOCATE('M', myColumn) SELECT
myColumn
FROM myTable
WHERE
SUBSTRING(myColumn, 1, LOCATE('M', myColumn) - 1) = '$myVariable'
;
SELECT
myColumn
FROM myTable
WHERE myColumn LIKE '$myVariable M%'
'