zoukankan      html  css  js  c++  java
  • sql随笔

    select c1.`pid` ,count(*) as num
    from `user_contact` as c1
    where c1.`uid` in
    (select a2.`user_id` as num from `order_orderlistrow` as a1
    INNER JOIN `order_orderlist` as a2 on a1.`order_orderlist_id` = a2.`id`
    INNER JOIN `user` as a3 on a2.`user_id` = a3.`id`
    where a1.`goods_good_id` = '64' and a2.`state` <> '0' and a2.`updatetime` > 1551369600 and a2.`updatetime` < 1554017391
    group by a2.`user_id`
    )
    GROUP BY c1.`pid`
    ORDER BY num desc

  • 相关阅读:
    开发日记1
    探索需求2
    探索需求1
    周总结8
    周总结7
    周总结6
    周总结5
    周总结4
    周总结3
    周总结2
  • 原文地址:https://www.cnblogs.com/daochong/p/10622506.html
Copyright © 2011-2022 走看看