[wd_asp elements=’search’ ratio=’100%’ id=1]

Query – One of each colour, highest ID of each – ‘Group By’ and ‘Order By’

14th March 2014

MySql

mysql codehaven category

This selected one of each colour, showing the highest id of each, where the website was called Codehaven.

SELECT * FROM (SELECT * FROM table1 WHERE website LIKE '%Codehaven%' ORDER BY id DESC) AS t GROUP BY colour