如果没有明确使用ISNULL,则左连接失败
I have a large table User and a small table User_purchase in google bigquery.
我有一个大表用户和google bigquery中的小表User_purchase。
If I join the two with
如果我加入两个
SELECT User.id, User_purchase.amount FROM User
LEFT JOIN User_purchase on User.id = User_purchase.user_id,
the query returns error:
查询返回错误:
Query Failed. Error: Not Implemented: This table cannot be read
查询失败。错误:未实现:无法读取此表
But if I join the two with
但如果我加入这两个
SELECT User.id, ISNULL(INTEGER(User_purchase.amount), INTEGER(0)) FROM User
LEFT JOIN User_purchase on User.id = User_purchase.user_id,
the query works.
查询有效。
Don't quite understand why the first case does not work. I assume in the first case I can get all users with their purchase_amount though some users will have NULL as their purchase_amount. Thanks.
不太明白为什么第一种情况不起作用。我假设在第一种情况下我可以使用purchase_amount获得所有用户,尽管有些用户将使用NULL作为purchase_amount。谢谢。
1 个解决方案
#1
4
This is a bug relating to nested field names in query replies. I've got a fix for the bug but it won't go out until next week's release. Thanks for bringing it to our attention.
这是与查询回复中的嵌套字段名称相关的错误。我已经修复了这个bug,但是在下周发布之前它不会发布。感谢您引起我们的注意。
更多相关文章
- 如何限制SQL Server中的用户登录尝试
- Mysql5.7.10版本安装后空密码登录,退出后提示密码错误连接不上解
- sql plus如何新建新用户
- PostgreSQL无法加载库未知错误14001
- QT 使用QSqlQuery时候的 错误,。。。。
- 参数化的Insert语句,事务抛出错误
- 错误:第t列。tgisconstraint不存在
- 请问MYSQL 08S01错误怎么解决,谢谢
- 处理SQL标准中的错误值