In MySQL , my sql is like following
SELECT * , IF( `Word` = 'sim', 1, IF( `Word` LIKE 'sim%', 2, IF( `Word` LIKE '%sim', 4, 3 ) ) ) AS `sort`
FROM `dblist`
WHERE `Word` LIKE '%sim%'
ORDER BY `sort` , `Word`
This sql is not working in SQlite. I want to do result order.
SELECT * FROM dblist where word like 'sim' or word like 'sim%' or word like '%sim%' or word like '%sim'
equal sim is a frist , sim% is second and %sim% is a thrid and then %sim is a last.
Currently I can't sort like mysql in sqlite. How to change sql to order the result ?