select null 的用法? [英] usage of select null?

查看:41
本文介绍了select null 的用法?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我看到一些示例使用带有 null 的 select 语句.何时使用:

I see that some examples uses select statement with null. When to use:

select null from etc. etc.?

推荐答案

Select null 通常与 EXISTS 结合使用.

Select null is usually used in combination with EXISTS.

eg:- IF EXISTS(select null from ...)

如果选择查询中有记录,则将 Exists 状态设置为 true.检查此链接,该链接对使用 Exists 的 select null 的用法有一些有趣的评论:SQL SERVER-IF EXISTS(从表中选择空值)与 IF EXISTS(从表中选择 1)

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)

这篇关于select null 的用法?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆