我想知道在存储过程中写入的选择语句的实际差异。SQL选择语句。
Select COUNT(1) from ref_user where [email protected]_user and [email protected];
和
Select * from ref_user where [email protected]_user and [email protected];
请指引我正确的,因为我是新来的数据库
我想知道在存储过程中写入的选择语句的实际差异。SQL选择语句。
Select COUNT(1) from ref_user where [email protected]_user and [email protected];
和
Select * from ref_user where [email protected]_user and [email protected];
请指引我正确的,因为我是新来的数据库
一会返回一个计数。另一个将返回数据。
Select COUNT(1) from ref_user where [email protected]_user and [email protected];
该函数返回ref_user
表的计数值。
Select * from ref_user where [email protected]_user and [email protected];
这个返回所有[数据]值。
第一个查询返回表中的行数,其中第二个查询返回表中的整个行。
COUNT函数是用于计数的行数
Select COUNT(1) from ref_user where [email protected]_user and [email protected];
返回匹配该输入的输入条件
Select * from ref_user where [email protected]_user and [email protected];
返回整个行(多个)匹配的记录数conditons