【发布时间】:2015-12-18 09:17:11
【问题描述】:
我有以下疑问:
SELECT a.*, CONCAT_WS(' ', `c`.`firstname`, `c`.`lastname`) AS `customer_fullname`
FROM `tickets` a
LEFT JOIN `customers` `c` ON (`a`.`id_customer` = `c`.`id_customer`)
WHERE a.`id_raffle` = 1 AND `customer_fullname` LIKE '%John%'
ORDER BY a.`id_ticket` ASC LIMIT 0,50
我得到了错误:
Unknown column 'customer_fullname' in 'where clause'
有什么建议吗?请注意,我无法重构查询,因为它是由我正在扩展的类生成的。
【问题讨论】:
标签: mysql sql select where alias