Oooh I can understand what you have done there, it is GOOD
I cannot however get it to run :( Syntex error! I have it to
sql code: CREATE TEMPORARY TABLE stevealikes
AS
(SELECT uid, 1 AS hair, 0 AS beard, 0 AS eyes FROM people_main WHERE des_haircolour = 'black')
UNION
(SELECT uid, 0 AS hair, 1 AS beard, 0 AS eyes FROM people_main WHERE des_facialhair = 'long')
UNION
(SELECT uid, 0 AS hair, 0 AS beard, 1 AS eyes FROM people_main WHERE des_eyecolour = 'green');
SELECT uid, hair, beard, eyes, SUM(hair,beard,eyes) AS total
FROM stevealikes
GROUP BY uid, hair, beard, eyes
ORDER BY total DESC;
To work with stuff, but alas, it still errors out :'S The top create-bit seems to run through without errors. It doesn't like me adding the SELECT bottom part XD
|