select 1 其实没什么特别的意思,就是select 一个指定的值,因为我的目地是判断是否有存在,所以不需要返回任何字段信息。写select 1比返回字段信息效率更高。。
select 1 from table where 1=1 。。
这样查询结果就是 1 ,行数等同于 select * from table where 1=1 。。的行数。

 

比方说:select 1 from employee, 表employee里有6行数据,那么select 1 from employee返回的结果却是竖着的6个1

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-10-13
  • 2022-02-06
  • 2022-03-09
  • 2021-12-22
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-05-27
  • 2022-12-23
  • 2021-10-20
  • 2022-12-23
相关资源
相似解决方案