group by 函数的使用

select a.product_code, a.oper_id
from t_product_trajectory a
  /* where a.product_code = '123'
  and a.oper_id = '22'*/
group by a.product_code, a.oper_id
having count(a.product_code) > 1 and count(a.oper_id) > 1

 

select * from t_product_trajectory   这张表是没有主键的。

 

 

posted @ 2020-03-15 19:41  ~码铃薯~  阅读(146)  评论(0编辑  收藏  举报