Help us understand the problem. What is going on with this article?

Athena の datetime 型のある Schema にて 時間・分・秒単位での行数を知る方法

More than 1 year has passed since last update.

datetime 型あり

SELECT format_datetime( DATETIME_COLUMN_NAME,'YYYY-MM-dd HH'), count(*)
FROM "ATHENA_DATABASE"."ATHENA_TABLE"
WHERE year=2018
        AND month=3
        AND (day=29
        OR day =30)
        GROUP BY format_datetime(DATETIME_COLUMN_NAME,'YYYY-MM-dd HH')
        ORDER BY format_datetime(DATETIME_COLUMN_NAME,'YYYY-MM-dd HH') ASC

format_datetime とかつかって datetime 型に変換するなら

SELECT format_datetime(date_parse(DATE_STR_COLUMN_NAME,'%d/%b/%Y:%H:%i:%s +0000'),'YYYY-MM-dd HH'), count(*)
FROM "ATHENA_DATABASE"."ATHENA_TABLE"
WHERE year=2018
        AND month=3
        AND (day=29
        OR day =30)
        GROUP BY format_datetime(date_parse(DATE_STR_COLUMN_NAME,'%d/%b/%Y:%H:%i:%s +0000'),'YYYY-MM-dd HH')
        ORDER BY format_datetime(date_parse(DATE_STR_COLUMN_NAME,'%d/%b/%Y:%H:%i:%s +0000'),'YYYY-MM-dd HH') ASC"

YYYY-MM-dd HH -> YYYY-MM-dd HH-mm

YYYY-MM-dd HH -> YYYY-MM-dd HH-mm-ss

Why do not you register as a user and use Qiita more conveniently?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away