Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

返す結果が各月分になっている #2

Open
lorentzca opened this issue Feb 28, 2017 · 0 comments
Open

返す結果が各月分になっている #2

lorentzca opened this issue Feb 28, 2017 · 0 comments

Comments

@lorentzca
Copy link
Owner

当月だけ出すクエリ。

SELECT SUM(cost) AS sum_cost, LEFT (FORMAT_UTC_USEC( UTC_USEC_TO_MONTH(TIMESTAMP_TO_USEC(start_time))), 7) AS month FROM データセット名.テーブル名 GROUP BY month HAVING month = LEFT (CURRENT_DATE(), 7) ORDER BY sum_cost DESC
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant