[求助]SQL中count()如何使用啊
在SQL中计算count 如何使用,请指教count()后的“()”里的填的数据是什么概念?
不是啊,count(*)选出的记录是大于或等于count(id),你去做个实验
create table shiyan(id int,name varchar(10))
insert into shiyan select 1,'a'
insert into shiyan(name) select 'b'
select count(*) from shiyan
select count(id) from shiyan
第一个返回的是2,第二个返回的是1,因为id有一行是null