Hi,
I have a problem with this query, seem the be getting a not unique error. Any ideas?
Thanks.
ERROR:Code:create temporary table uo1 (key (user_id)) select user_id, group_concat(o.occupation SEPARATOR ', ') as occupation from users_occupations as uo inner join occupations as o on o.id = uo.occupation group by user_id; create temporary table jt1 (key (user_id)) select user_id, group_concat(j.job_type SEPARATOR ', ') as job_type from users_job_types as jt inner join job_types as j on j.id = jt.job_type group by user_id; create temporary table ks1 (key (user_id)) select user_id, group_concat(k.key_skill SEPARATOR ', ') as key_skill from users_keyskills as ks inner join key_skills as k on k.id = ks.key_skill group by user_id; select users.title, users.first_name, users.last_name, users.gender, users.city, users.county, users.cv_text, users.signup_date, users_profile.*, uo1.occupation, jt1.job_type, ks1.key_skill from users inner join users_profile on users_profile.userid = users.id left outer join uo1 on uo1.user_id = users.id left outer join jt1 on jt1.user_id = users.id left outer join ks1 on ks1.user_id = users.id inner join ( select user_id from users_job_types where job_type in (1002,1003,1004) group by user_id ) as jts on jts.user_id = users.id inner join ( select user_id from users_sectors where sector in (1040,1021,1024,1027) group by user_id ) as sec on sec.user_id = users.id inner join ( select user_id from users_occupations where occupation in (14,27,45,46) group by user_id ) as occ on occ.user_id = users.id inner join ( select user_id from users_job_types where job_type in (1003) group by user_id ) as jts on jts.user_id = users.id inner join ( select user_id from users_sectors where sector in (1011) group by user_id ) as sec on sec.user_id = users.id inner join ( select user_id from users_occupations where occupation in (51) group by user_id ) as occ on occ.user_id = users.id where users.status='1' and users.signup_date > DATE_SUB(NOW(), INTERVAL 24 HOUR) group by users.id
Code:#1066 - Not unique table/alias: 'jts'



Reply With Quote





Bookmarks