摘要: where是对数据直接处理,having是对产生的结果再进行处理 select goods_id,goods_name,market_price-shop_price as k from goods where market_price-shop_price >200;上语句只能使用 where market_price-shop_price>200 而不能使用 where k... 阅读全文
posted @ 2013-11-22 23:40 long896130895 阅读(182) 评论(0) 推荐(0)
摘要: mysql> select goods_name,shop_price from goods where cat_id=3 and(shop_price5000) and click_count>5;+----------------+------------+| goods_name | shop_price |+----------------+------------+| 多普... 阅读全文
posted @ 2013-11-22 23:08 long896130895 阅读(133) 评论(0) 推荐(0)
摘要: where——group——having——order by——limit 阅读全文
posted @ 2013-11-22 20:08 long896130895 阅读(156) 评论(0) 推荐(0)
摘要: order by 最终结果集出来后,可以再排序,反过来说排序就是针对最终结果集,即:order by 要放在 where/group/having 之后 order by 后面可以跟一列或者多列要排序的字段,并且使用DESC或者ASC关键字排序 其中DESC代表是降序 ASC代表是升序 limit 在语句最后,起到限制条目的作用 阅读全文
posted @ 2013-11-22 15:04 long896130895 阅读(285) 评论(0) 推荐(0)