Home > Software engineering >  Bigquery numeric datetime to string datetime
Bigquery numeric datetime to string datetime

Time:06-20

I have written a query in bigquery like below:

 SELECT date_trunc(dd.created_date, week) AS week_signup,
  COUNT(DISTINCT dd.user_id) AS total_signup,
  COUNT(dd.resume_upload_date) AS resume_uploaded
FROM
  devdb_mirror.developer_detail dd
  LEFT JOIN devdb_mirror.user_list_v4 du ON dd.id = du.id
WHERE
  regexp_extract(du.email, r '@(. )') != 'gmail.com'
GROUP BY
  date_trunc(dd.created_date, week);

Output:

week_signup total_signup resume_uploaded
2020-02-02 00:00:00 625 382
2020-03-22 00:00:00 1059 329

i want the week_signup column data format like this(just month and day):

week_signup total_signup resume_uploaded
Feb 02 625 382
Mar 03 1059 329

How can i write this in bigquery to get this??

CodePudding user response:

Use format_date for the same.

E.g. FORMAT_DATE("%a %d", date_trunc(dd.created_date, week))

  • Related