sql - 无法绑定(bind)多部分标识符

标签 sql sql-server tsql

select (case when t.freeplayabandoned != f.freeplayabandoned then 'freeplayabandoned'
             when t.freeplaydownloaded != f.freeplaydownloaded then 'freeplaydownloaded'
    end) 
from testtable t where not exists (select * from freeplay.egmfreeplay f  where f.freeplaydownloaded  = t.freeplaydownloaded)

我试图获取与 freeplay.egmfreeplay 不匹配的 testtable 记录的列名

我收到以下错误

消息 4104,级别 16,状态 1,第 1 行 无法绑定(bind)多部分标识符“f.freeplayabandoned”。 消息 4104,级别 16,状态 1,第 1 行 无法绑定(bind)多部分标识符“f.freeplaydownloaded”。

有人可以帮忙吗??

最佳答案

f 在对 exists 的调用内的子查询内限定范围。您不能在子查询之外使用它。

关于sql - 无法绑定(bind)多部分标识符,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/982626/

相关文章:

sql - SQL Server 函数 Convert 的 Postgresql 等价物

c# - 快速更新 MSSQL 中的列

使用 CTE 的 SQL Server 2008 动态查询

单引号的 SQLServer 函数

sql-server - 如何将序列号连接到不相关的数据 (SQL Server)

sql - 在存储过程参数列表中使用表达式(例如函数调用)的结果?

mysql - 如何从MySQL中的多个表中删除?

sql - 如何在包含空值的列上添加非空约束

sql-server - SQL : find continuous date ranges across multiple rows?

php - 将字段添加到数据库/覆盖现有下拉列表中的默认选项