【发布时间】:2012-07-30 20:54:08
【问题描述】:
可在此处找到 Google SQL 语法指南 https://developers.google.com/bigquery/docs/query-reference 似乎没有解决 NOT IN 术语的使用问题。
我得到了错误
Query Failed
Error: Encountered "" at line 0, column 0. Was expecting one of:
(然后 Google 在“one of”之后什么都没有列出)
当我的查询是
SELECT ageinmonths,amountborrowed,borrowerrate,creationdate,creditgrade,
debttoincomeratio,groupkey,key,lenderrate,listingkey,modifieddata,
originationdate,prosperrating,status,term
FROM prosperloans1.loans2 as big,
prosperloans1.dupelistingkeysinloans2 as small
WHERE big.listingkey NOT IN small.listingkey
“小”表有 14 行。大表有 57K 行。
有什么想法吗? 不确定 Google SQL 是否支持 NOT IN。
谢谢 肖恩
【问题讨论】:
-
使用in 和不使用in 不需要括号吗?例如select * from dual where id not in (1, 2, 3)
-
这似乎有效:SELECT ageinmonths,amountborrowed,borrowerrate,creationdate,creditgrade,debttoincomeratio,groupkey,key,lenderrate,listingkey,modifieddata,originationdate,prosperrating,status,term FROM prosperloans1.loans2 WHERE listingkey NOT IN(从 prosperloans1.dupelistingkeysinloans2 中选择列表键)
标签: google-bigquery