201606's People
201606's Issues
06sql
SELECT
t3.shop_id,
t3.shop_name,
sum(r.totsnu) tsnu,
sum(r.totsmo) tsmo,
sum(r.quantity) trenu,
sum(r.restmo) tremo
FROM
(
SELECT
t1.item_id,
t1.totsnu,
t1.totsmo,
t2.quantity,
t2.restmo
FROM
(SELECT
item_id,
sum(day_sold) totsnu,
sum(daysmo) totsmo
FROM
(SELECT
item_id,
day_sold,
day_sold_price daysmo
FROM t_base_ec_item_daysale_dev_new) t
GROUP BY item_id) t1
JOIN
(SELECT
item_id,
qu quantity,
cast(price * qu AS FLOAT) restmo
FROM t_base_ec_item_sold_dev
WHERE ds = '20160528') t2
ON t1.item_id = t2.item_id
) r
JOIN
(SELECT
y1.item_id,
y1.shop_id,
y2.shop_name
FROM (SELECT
item_id,
shop_id
FROM t_base_ec_item_dev_new
WHERE ds = '20160607' AND bc_type = 'B') y1
JOIN
(SELECT
shop_id,
shop_name
FROM t_base_ec_shop_dev
WHERE ds = '20160613'
) y2
ON y1.shop_id = y2.shop_id
) t3
ON r.item_id = t3.item_id
GROUP BY shop_id,shop_name
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.