BigQuery - how to compare a “date” column (using legacy SQL)?

后端 未结 2 566
别跟我提以往
别跟我提以往 2021-02-05 12:14

I have a BigQuery table with a column Date which is a date type. I am trying to run this query:

SELECT * FROM dataset.table_name WHERE          


        
2条回答
  •  陌清茗
    陌清茗 (楼主)
    2021-02-05 12:36

    Try below

    WHERE DATE(Date) = "2016-07-11"
    

    My additional recommendation would be to not to use reserved words as column's name, I think if your column was named properly - your original WHERE clause would worked perfectly and you would not need to use workaround with DATE()=""

提交回复
热议问题