我遇到了这段代码的问题.错误接近LIKE.这是代码……
try {
$st = $db->query('SELECT', "SELECT a.`fast_cash` as `fast`, a.`urgent_cash` as `urgent`, b.`store_name` as `store` FROM `Locations` a LEFT JOIN `loan_balances` b ON b.`store_name` LIKE '%' + a.`nick` + '%'", 'array');
} catch (Exception $e) {
echo $e->getMessage();
}
最佳答案 您正在寻找的on子句是:
ON b.`store_name` LIKE concat('%', a.`nick`, '%')
此查询不需要where子句.