刚刚你帮我解决的问题
select * from msg a where exists(
select 1 from dbo.f_tb(6) where charindex(','+cast(id as varchar)+',',','+a.Depts+',')>0
请问这个select 1代表什么含义?
能简单讲解下这条语句吗
我不清楚这个select 1 有什么作用
为什么不是select id
我单独写select 1 from db.f_tb(6) 时,返回的结果都是1
select * from msg a where exists(
select 1 from dbo.f_tb(6) where charindex(','+cast(id as varchar)+',',','+a.Depts+',')>0
请问这个select 1代表什么含义?
能简单讲解下这条语句吗
我不清楚这个select 1 有什么作用
为什么不是select id
我单独写select 1 from db.f_tb(6) 时,返回的结果都是1
1在这是没意义的,你换成2,*,....都可以~
这里只是返回一个真假值
外部查询的 WHERE 子句测试子查询返回的行是否存在。
子查询实际上不产生任何数据;它只返回 TRUE 或 FALSE 值。看联机帮助