This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
order | custid | timestamp | dat | longitude | latitude | |
---|---|---|---|---|---|---|
4 | 100 | 2021-01-04 11:12:00 | 2021-01-04 | 35.281252 | 139.148774 | |
5 | 100 | 2021-01-05 11:12:00 | 2021-01-05 | 34.781419 | 141.148126 | |
1 | 101 | 2021-01-06 11:12:00 | 2021-01-06 | 34.161496 | 134.973137 | |
2 | 101 | 2021-01-07 11:12:00 | 2021-01-07 | 35.346222 | 136.132054 | |
1 | 100 | 2021-01-01 11:12:00 | 2021-01-01 | 36.677188 | 140.776565 | |
2 | 100 | 2021-01-02 11:12:00 | 2021-01-02 | 35.665193 | 139.834104 | |
3 | 100 | 2021-01-03 11:12:00 | 2021-01-03 | 36.064589 | 138.149098 | |
3 | 101 | 2021-01-08 11:12:00 | 2021-01-08 | 36.392858 | 136.087820 | |
4 | 101 | 2021-01-09 11:12:00 | 2021-01-09 | 37.207481 | 137.689071 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
番号 | 件数 | 要素 | 状態 | |
---|---|---|---|---|
1 | 1 | 1 | 時間帯 | 昼 | |
2 | 1 | 1 | 時間帯 | 昼 | |
3 | 1 | 1 | 時間帯 | 昼 | |
4 | 1 | 1 | 時間帯 | 夜 | |
5 | 3 | 1 | 時間帯 | 夜 | |
6 | 12 | 1 | 時間帯 | 夜 | |
7 | 31 | 1 | 時間帯 | 夜 | |
8 | 1 | 1 | 時間帯 | 夜 | |
9 | 2 | 1 | 時間帯 | 夜 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
グループ番号 | グループ名 | 名前 | 状態 | 年 | 順序 | |
---|---|---|---|---|---|---|
1 | The Rolling Stones | The Rolling Stones | グループ | 1962-01-01 | 1 | |
1 | The Rolling Stones | Ian Stewart | メンバー | 1962-01-01 | 1 | |
1 | The Rolling Stones | Bill Wyman | メンバー | 1962-01-01 | 1 | |
1 | The Rolling Stones | Charlie Watts | メンバー | 1962-01-01 | 1 | |
1 | The Rolling Stones | Mick Jagger | メンバー | 1962-01-01 | 1 | |
1 | The Rolling Stones | Keith Richards | メンバー | 1962-01-01 | 1 | |
1 | The Rolling Stones | Brian Jones | メンバー | 1962-01-01 | 1 | |
1 | The Rolling Stones | Mick Taylor | メンバー | 1969-07-01 | 1 | |
1 | The Rolling Stones | Ron Wood | メンバー | 1975-01-01 | 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
名前f | 名前t | 同時注文数 | リフト | |
---|---|---|---|---|
鮪 | 鰤 | 21 | 1 | |
秋刀魚 | 赤魚 | 12 | 0.8 | |
甘鯛 | かんぱち | 9 | 1.6 | |
赤魚 | 鰯 | 8 | 1.3 | |
秋刀魚 | しめ鯖 | 21 | 0.9 | |
赤魚 | 蟹味噌 | 6 | 1.1 | |
甘海老 | 蟹味噌 | 21 | 1.6 | |
鰤 | かんぱち | 43 | 1.3 | |
秋刀魚 | かんぱち | 12 | 1.5 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
select | |
顧客番号, | |
契約番号, | |
count(*) as 件数 | |
from データベース名.テーブル名 | |
group by 1,2 | |
having count(*) >1 | |
; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
with src as ( | |
select | |
製品番号, | |
製品名称 | |
from データベース名.テーブル名 | |
group by 1,2 | |
) | |
, idchk as ( | |
select | |
製品番号 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
select | |
顧客番号, | |
契約番号, | |
row_number() over(partition by 顧客番号,契約番号 order by 更新日付 desc) as rndesc | |
from データベース名.テーブル名 | |
qualify rndesc=1 | |
; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
顧客番号 | レシート番号 | 日付時刻 | 商品 | 数量 | 売価 | 割引 | |
---|---|---|---|---|---|---|---|
1 | 111 | 2022-03-16 10:15:33 | キャベツ | 2 | 300 | 0 | |
1 | 111 | 2022-03-16 10:15:33 | たまご | 3 | 450 | 0 | |
1 | 111 | 2022-03-16 10:15:33 | 豚バラ肉300g | 5 | 1300 | 0 | |
2 | 118 | 2022-03-16 12:09:12 | お茶500ml | 1 | 98 | 0 | |
2 | 118 | 2022-03-16 12:09:12 | 鮭弁当 | 1 | 450 | 0 | |
3 | 131 | 2022-03-16 18:59:34 | お寿司 | 1 | 500 | 100 | |
3 | 131 | 2022-03-16 18:59:34 | 牛乳1L | 1 | 200 | 0 | |
3 | 131 | 2022-03-16 18:59:34 | 食パン6枚ぎり | 1 | 150 | 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
select | |
顧客番号, | |
substring(to_char(日付) from 1 for 7) as 年月, | |
count(*) as 売上回数, | |
sum(売上金額) as 売上金額合計, | |
avg(売上金額) as 売上金額平均, | |
min(売上金額) as 売上金額最小, | |
max(売上金額) as 売上金額最大, | |
stddev_pop(売上金額) as 売上金額標準偏差, | |
stddev_pop(売上金額) / avg(売上金額) as 売上金額変動係数, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
select | |
col1 | |
from データベース名.テーブル名 | |
group by 1 | |
; |
OlderNewer