我正在使用以下查询
SELECT COALESCE(curr_bid, start_bid) AS `bid`, `lot`.*, (SELECT COUNT(id) from bid where lot_id=lot.id) as bids_count FROM `lot` LEFT JOIN (SELECT `lot_step`.`id`, `lot_step`.`lot_id`, max(amount) as curr_bid FROM `lot_step` GROUP BY `lot_step`.`lot_id`) `ls` ON lot.id = ls.lot_id WHERE ((`bid` >= '100') AND (`bid` <= '100000000'))
但是我总是得到Unknown column 'bid' in 'where clause'
。不确定如何发生,因为我在SELECT之后指定了列