エントリーの編集
![loading...](https://b.st-hatena.com/bdefb8944296a0957e54cebcfefc25c4dcff9f5f/images/v4/public/common/loading@2x.gif)
エントリーの編集は全ユーザーに共通の機能です。
必ずガイドラインを一読の上ご利用ください。
記事へのコメント0件
- 注目コメント
- 新着コメント
このエントリーにコメントしてみましょう。
注目コメント算出アルゴリズムの一部にLINEヤフー株式会社の「建設的コメント順位付けモデルAPI」を使用しています
![アプリのスクリーンショット](https://b.st-hatena.com/bdefb8944296a0957e54cebcfefc25c4dcff9f5f/images/v4/public/entry/app-screenshot.png)
- バナー広告なし
- ミュート機能あり
- ダークモード搭載
関連記事
group byの注意点 - 極北データモデリング
今日、こんな感じのテーブルを作って、毎晩日次売上を月次売上に足しこむバッチを走らせる、という仕事... 今日、こんな感じのテーブルを作って、毎晩日次売上を月次売上に足しこむバッチを走らせる、という仕事をした。 ●店舗別日次売上 create table daily ( store_id integer not null primary key, -- 店舗ID store_group_id integer not null, -- 店舗が所属する店舗グループID sales bigint not null -- 今日の売上 ); ●店舗別月次売上 create table monthly ( store_id integer not null primary key, store_group_id integer not null, sales bigint not null );やり方を2つ思いついた。 full outer join でヨコに結合して足し算 union でタテ積みして集計