jmbejara / comp-econ-sp18

Main Course Repository for Computational Methods in Economics (Econ 21410, Spring 2018)
16 stars 23 forks source link

SQL Assignment: issue with timestamps #62

Closed benpicker closed 6 years ago

benpicker commented 6 years ago

For https://www.kaggle.com/dansbecker/exercise-as-with/code,

1) How many Bitcoin transactions were made each day in 2017? You can use the "timestamp" column from the "transactions" table to answer this question. You can go back to the order-by tutorial for more information on timestamps.

I don't understand what to do with the timestamps. For example "1505660703000". Extract doesn't work on integers. Am I supposed to convert this into a datetime format? If so, how? I've googled, but don't see such a method/function.

jmbejara commented 6 years ago

You should convert it first. I'm using the following line in my code:

SELECT TIMESTAMP_MILLIS(timestamp) AS trans_time