我遇到了这段代码的麻烦。错误接近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();
}
答案 0 :(得分:2)
您正在寻找的on
子句是:
ON b.`store_name` LIKE concat('%', a.`nick`, '%')
此查询不需要where
子句。