select  1 from dual

  

 
在这条sql语句中的1代表什么意思?查出来是个什么结果?
 
其实:
select 1 from table;
select anycol(目的表集合中的任意一行) from table;  -- (目的表集合中的任意一行)
select * from table

  

 
上面这三条语句从作用上来说是没有差别的,都是查看是否有记录,一般是作条件查询用的。
 
select 1 from 中的1是一常量(可以为任意数值),查到的所有行的值都是它,但从效率上来说,1>anycol>*,因为不用查字典表。

相关文章:

  • 2022-12-23
  • 2021-07-03
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-22
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-02-06
  • 2021-07-03
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-11-23
相关资源
相似解决方案