I have created following query, the query is inject _thumb before image extension, but the query is not working at all conditions,
SELECT `user_id`,`image`,
CONCAT(SUBSTRING_INDEX(`image`,'.',1),'_thumb.',SUBSTRING_INDEX(`image`,'.',-1))
as `image_thumb`
FROM `user_details`
Result
user_id |image |image_thumb
--------|-----------|--------------------
1 |gk1.JPG |gk1_thumb.JPG
2 |Tulips.jpg |Tulips_thumb.jpg
3 |vnc.1.jpg |vnc_thumb.jpg
4 |NULL |NULL
10 |NULL |NULL
user_id 3 row image_thumb not expected
I want to result:
3 |vnc.1.jpg |vnc.1_thumb.jpg
Can you please anyone help me to create right query?