I\'m trying to create a (sqlite) query that will perform a GROUP BY but will not group anything with the value \'unknown\'. For example, I have the table:
SELECT
MIN(id) AS id,
IF(tmpname=id,"unknown",tmpname) AS name,
parent_id,
school_id
FROM (
SELECT
id,parent_id,school_id
IF(name="unknown",id,name) AS tmpname
FROM
) AS baseview
GROUP BY tmpname