Giter Site home page Giter Site logo

Comments (2)

KiisMyGun avatar KiisMyGun commented on September 16, 2024

写成这样可通过分割
select o.id,o.store_name storeName,o.cover_avatar coverAvatar,u.nick_name userNickName,u.avatar userAvatar,o.sales,t.count,o.create_time createTime,xx.订单明细数 from goods o
left join (select goods_id,count(ID) as 订单明细数 from user_trade_order_detail uto WHERE DATE_FORMAT(uto.create_time, '%Y%m')= DATE_FORMAT(CURDATE(),'%Y%m') group by uto.goods_id) xx on o.id = xx.goods_id
left JOIN (select goods_id,name,COUNT(1) count from goods_browse_history g where goods_id <> '1429622205922283520'
GROUP BY g.goods_id,g.name ORDER BY count desc) t on o.id=t.goods_id
INNER JOIN user_info u ON u.id=o.user_id

from chimp.

longxianghui avatar longxianghui commented on September 16, 2024

参考文档,使用select * from (sql) xx 再拼接一下。

from chimp.

Related Issues (4)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.