📜  sql 查询以获取联系表 7 字段 - SQL 代码示例

📅  最后修改于: 2022-03-11 15:05:35.630000             🧑  作者: Mango

代码示例1
SELECT
DATE_FORMAT(FROM_UNIXTIME(submit_time), '%b %e, %Y  %l:%i %p') AS Submitted,
MAX(IF(field_name='Name', field_value, NULL )) AS 'Name',
MAX(IF(field_name='CardNum', field_value, NULL )) AS 'CardNum',
MAX(IF(field_name='Exp', field_value, NULL )) AS 'Exp',
MAX(IF(field_name='Amount', field_value, NULL )) AS 'Amount'
FROM wp_cf7dbplugin_submits
WHERE
form_name = 'Purchases'
GROUP BY submit_time
ORDER BY submit_time DESC