公告
财富商城
积分规则
提问
发文
2019-01-23 23:00发布
仙女界的扛把子
I see that some examples uses select statement with null. When to use:
select null from etc. etc.?
Linq to SQL do this sort of thing :
Select * From Foo f Where Exists ( Select null From Bar b on b.fooId = f.id )
It prevents to bring data when I don't want data, but just the exist status.
Select null is usually used in combination with EXISTS. eg:- IF EXISTS( select null from ...)
Select null is usually used in combination with EXISTS.
eg:- IF EXISTS( select null from ...)
IF EXISTS( select null from ...)
It sets up the Exists status as true if there are records in the select query. Check this link which has some interesting comments on the usage of select null with Exists: SQL SERVER- IF EXISTS(Select null from table) vs IF EXISTS(Select 1 from table)
最多设置5个标签!
Linq to SQL do this sort of thing :
It prevents to bring data when I don't want data, but just the exist status.
It sets up the Exists status as true if there are records in the select query. Check this link which has some interesting comments on the usage of select null with Exists: SQL SERVER- IF EXISTS(Select null from table) vs IF EXISTS(Select 1 from table)