比如有表格go_shoplist,字段为id,qishu,maxqishu 查询的记录为.qishu与maxqishu相同的行.
select * from `go_shoplist` where qishu=maxqishu
下面的写法也正确,模拟联表查询其实查询的是同一个表,用到left join
SELECT a.qishu, a.id, b.maxqishu FROM `go_shoplist` a LEFT JOIN `go_shoplist` b ON a.id = b.id WHERE a.qishu = b.maxqishu LIMIT 0 , 30