GithubHelp home page GithubHelp logo

201606's People

Watchers

James Cloos avatar lee_chiron avatar

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 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.