having()方法设置查询条件,where()设置查询条件

  having  where区别

① 使用有先后顺序

② where  price>100     having price>100

③ where  设置条件,字段必须是数据表中存在的字段

④ having 设置条件,字段必须是select语句查询出来的字段可以使用

原文地址:https://www.cnblogs.com/8000cabbage/p/6253845.html