我正在尝试使用标准SQL将字符串“ 181201”转换为Google Big Query中的“日期”字段。
例如181201-> 2018-12-01
我尝试使用以下命令,因为我输入的原始日期将整个年份拼写为“ 2018”,所以我尝试使用以下命令。但是,我没有在数据集中写出全年的数据。
SELECT PARSE_DATE('%YY%m%d', '20181201') AS DATE
如何更新查询以仅使用yymmdd给我yyyy-mm-dd? 谢谢!
答案 0 :(得分:3)
inputs = [] #define the list outside the loop to make sure it gets populated with every single json string
for url_to_get_data_from in file: #for every url...
while y < 50:
item = str(json_string_from_the_internet[y])
#this item is sometimes unique but not always...
if(item in inputs): #lets see if this json string is in the list
print("This already exists in our inputs list, so we skip it")
else:
inputs.append(item) #add the item for the upcoming loop cycles
print("this item does not exist in our inputs, we continue with our code below")
print("no more while loop and no more urls...done with work)