У меня есть эти две таблицы
FunctionName | value
-------------+---------
intensity | 0
status | NULL
и
FunctionName | StatusName
-------------+------------
status | ON
status | Off
Я использую этот запрос:
SELECT
Functions.FunctionName, Functions.value,
GROUP_CONCAT(FunctionsWithStatus.StatusName)
FROM
Functions
LEFT JOIN
FunctionsWithStatus ON Functions.FunctionName = FunctionsWithStatus.Functionsname
Результат:
Name | value | group_concat
status | 0 | off,on
Как я также могу получить значение "интенсивности" и получить такой результат:
Name | value | group_concat
intensity | 0 | NUll
status | 0 | off,on