In the following query am trying to get one image per category
SELECT l.* FROM ( SELECT id AS category_id, COALESCE( ( S
replace * with a single column for images li
*
images li