美好的一天,我在查询中有什么变化?
'SELECT a.first_name,
a.last_name,
a.birth_date,
a.email,
a.aba_email,
a.phone,
a.mobile_phone,
FROM passport a
INNER JOIN USER c ON a.id=c.passport_id
INNER JOIN consultant b ON b.user_id=c.id
WHERE c.id = :user_id
AND b.create_time BETWEEN UNIX_TIMESTAMP(DATE_FORMAT(:begin_date,"%Y-%m-%d 00:00:00")) AND UNIX_TIMESTAMP(DATE_FORMAT(:end_date,"%Y-%m-%d 23:59:59"))'
我得到了错误
答案 0 :(得分:1)
我认为它是在mobile_phone之后的逗号,只有在其后有另一列时才需要逗号。
'SELECT a.first_name,
a.last_name,
a.birth_date,
a.email,
a.aba_email,
a.phone,
a.mobile_phone
FROM passport a
INNER JOIN USER c ON a.id=c.passport_id
INNER JOIN consultant b ON b.user_id=c.id
WHERE c.id = :user_id
AND b.create_time BETWEEN UNIX_TIMESTAMP(DATE_FORMAT(:begin_date,"%Y-%m-%d 00:00:00")) AND UNIX_TIMESTAMP(DATE_FORMAT(:end_date,"%Y-%m-%d 23:59:59"))'