msyql判断记录是否存在的三种方法时间:2023-03-09 12:59:48 1. select count(*) from .... 这种方法最常见但是效率比较低,因为它需要扫描所有满足条件的记录 2. select 1 from xxxtable where .... 这种方式效率比较高 3.在第2中方式的基础上结合exist函数 select exists(select 1 from 表名 where `number` = idnumber) ; 今天突然想到的这种方式,返回值为0或者1,感觉很好用,特此记录