oracle中的select 1 from 表名的含义~
2013-03-05 15:29
501 查看
1、select 1 from table 与 select anycol(table中的任意一行) from table 与 select * from table 作用上没有差别,都是查询是否有记录。select 1 from table 中的“1”是一个常量,所以查询出来的所以行都是它,但从效率上来说:1 > anycol >*,因为不用查字典表。
2、查看记录条数可以用select sum(1) from table; 等价于 select sum(*) from table;
3、(1)select 1 from table 增加临时列,每行的列值是写在select后的数,这条sql语句中是1
(2)select count(1) from table 不管count(a)的a值如何变化,得出的值总是table表的行数
(3)select sum(1) from table 计算临时列的和。
相关文章推荐
- [转]oracle update set select from 关联更新
- oracle查询语句中select from where group by having order by的解释与应用
- select 语句 没有 FROM oracle /MSSQL 对比
- oracle查询语句中select from where group by having order by的解释与应用
- select DATA FROM THE SIXTH TO TENTH(ORACLE)
- 如何把oracle中的select sysdate from dual转化为SQL Server中的语句?
- 创建表结构相同的表,表结构相同的表之间复制数据,Oracle 中 insert into XXX select from 的用法
- Oracle select * from table 存储过程
- oracle create table a as select * from b
- oracle查询语句中select from where group by having order by的解释与应用
- 关于Oracle中select * from where 的存储过程
- select 1 from dual 中的1表示的含义
- oracle insert into select * from tablename
- Oracle基础知识(5)--select...from...where...group by...having...order by...
- 【Oracle】INSERT INTO SELECT语句和SELECT INTO FROM语句的区别
- Oracle中 insert into select与 select into from的区别
- oracle update set select from 关联更新
- oracle 中 create table tb_content_bak as select * from tb_content where 1=2 long字段解决办法
- Oracle select --字符函数:TRANSLATE(string,from_str,to_str)
- Oracle 删除重复数据只留一条 查询及删除重复记录的SQL语句 1、查找表中多余的重复记录,重复记录是根据单个字段(Id)来判断 select * from 表 wher