Duplicate entry '3314' for key 'group_key'
CREATE TEMPORARY TABLE content_db AS ( select m.*, mv.* from (SELECT pid as temp_matching_id , MAX(IF(field = 'is_cat', value, NULL)) AS 'is_cat' , MAX(IF(field = 'pid', value, NULL)) AS 'pid' , MAX(IF(field = 'level', value, NULL)) AS 'level' , MAX(IF(field = 'name_tc', value, NULL)) AS 'name_tc' , MAX(IF(field = 'name_en', value, NULL)) AS 'name_en' , MAX(IF(field = 'content_tc', value, NULL)) AS 'content_tc' , MAX(IF(field = 'content_en', value, NULL)) AS 'content_en' , MAX(IF(field = 'banner_tc', value, NULL)) AS 'banner_tc' , MAX(IF(field = 'banner_en', value, NULL)) AS 'banner_en' , MAX(IF(field = 'meta_keywords', value, NULL)) AS 'meta_keywords' , MAX(IF(field = 'meta_desc', value, NULL)) AS 'meta_desc' , MAX(IF(field = 'permalink', value, NULL)) AS 'permalink' , MAX(IF(field = 'link', value, NULL)) AS 'link' , MAX(IF(field = 'edit', value, NULL)) AS 'edit' , MAX(IF(field = 'editor', value, NULL)) AS 'editor' , MAX(IF(field = 'show_top', value, NULL)) AS 'show_top' , MAX(IF(field = 'show_left', value, NULL)) AS 'show_left' , MAX(IF(field = 'show_sitemap', value, NULL)) AS 'show_sitemap' , MAX(IF(field = 'show_Banner', value, NULL)) AS 'show_Banner' FROM main_value_db group by pid ) as mv left join main_db m on m.id = mv.temp_matching_id where m.module = 'content' )