What does it mean by select 1 from table?

前端 未结 15 1850
南方客
南方客 2020-12-07 07:32

I have seen many queries with something as follows.

Select 1  
From table

What does this 1 mean, how will it be executed and,

15条回答
  •  情歌与酒
    2020-12-07 08:06

    it does what it says - it will always return the integer 1. It's used to check whether a record matching your where clause exists.

提交回复
热议问题