我在mysql中编写了一个查询,如下所示:
SELECT inquiry_id, event_name,MAX(ValueData1) as ValueData1
,MAX(ValueData2) as ValueData2
,MAX(ValueData3) as ValueData3
,MAX(ValueData4) as ValueData4
FROM
(
SELECT inquiry_id,event_id,event_name
,CASE WHEN mailer_id = 1 THEN CONCAT( Edition,' - ',sent_on) END AS ValueData1
,CASE WHEN mailer_id = 2 THEN CONCAT( Edition,' - ',sent_on) END AS ValueData2
,CASE WHEN mailer_id = 3 THEN CONCAT( Edition,' - ',sent_on) END AS ValueData3
,CASE WHEN mailer_id = 4 THEN CONCAT( Edition,' - ',sent_on) END AS ValueData4
FROM crm_support_inquiry
) AS crm_support_inquiry
GROUP BY inquiry_id,event_id,event_name
其输出如下:
当我运行查询并尝试在网格视图中显示数据时,我只在输出中得到两个字段,即inquiry_id和event_name,即前两个字段。剩余字段未显示。什么是要做?我希望在网格视图中显示完整的查询输出。