Comments (2)
写成这样可通过分割
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.
参考文档,使用select * from (sql) xx 再拼接一下。
from chimp.
Related Issues (4)
- 试了一下好像不支持EF3.0,有计划做吗? HOT 2
- sql语句多个order by 问题 HOT 2
- 改造成同时支持多Db的呀 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from chimp.