“select table as table from tablename”是什么意思?在SQL Server? [英] What is the meaning of "select 1 as count from tablename" in sql server?

查看:222
本文介绍了“select table as table from tablename”是什么意思?在SQL Server?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在sql server中select 1 as table from tablename是什么意思?

解决方案

看起来没用,除非你想获得一个包含的记录集''1',记录集中的记录数等于tablename中的行数。


它将1显示为值和列名称为COUNT,如下所示。 />


 COUNT 
----------
1


这将只返回1的no.of列,该列在表中可用作输出,列名称为Count


What is the meaning of "select 1 as count from tablename" in sql server?

解决方案

Seems useless, unless you want to get a recordset that consists of ''1''s with number of records in recordset equal to number of rows in tablename.


It will Display 1 as a Value and Column name as COUNT, as shown below.

COUNT
----------
1


This will just return 1 for no.of column which is available in table as output and column name as Count


这篇关于“select table as table from tablename”是什么意思?在SQL Server?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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