I need some help. I googled for solution, but I didn\'t found one.
I have three tables:
langs
(int) id | (varchar) language
1 | English
SELECT CONCAT(
' SELECT `value`.`key_id`,'
, '`keys`.`keys`,'
, GROUP_CONCAT(
'GROUP_CONCAT(IF(`value`.`lang_id`=',id,',`value`.`value`,NULL))'
, ' AS `', REPLACE(language, '`', '``'), '`'
)
, ' FROM `keys` JOIN `value` ON `value`.`key_id` = `keys`.`id`'
, ' GROUP BY `value`.`key_id`'
)
INTO @sql
FROM `langs`;
PREPARE stmt FROM @sql;
EXECUTE stmt;
DEALLOCATE PREPARE stmt;