当前位置:编程学习 > C#/ASP.NET >>

sql 查询一个表中有多少条数据?

sql 查询一个表中有多少条数据?
表 table 
字段 ID  name 
比如 现在表中有五条数据

我想知道 sql 语句怎么写能得到表中有多少条数据啊?
--------------------编程问答-------------------- select count(*) from table --------------------编程问答--------------------
select count(1) from table
--------------------编程问答-------------------- select count(1) from table --------------------编程问答-------------------- 从效率上讲
2楼比1楼要高 
select count(1) from table
--------------------编程问答--------------------
引用 4 楼 q107770540 的回复:
从效率上讲
2楼比1楼要高 
select count(1) from table

学习了,count(1) 怎么解释 --------------------编程问答--------------------
引用 4 楼 q107770540 的回复:
从效率上讲
2楼比1楼要高 
select count(1) from table
同意! --------------------编程问答-------------------- select count(1) from table --------------------编程问答--------------------
引用 4 楼 q107770540 的回复:
从效率上讲
2楼比1楼要高 
select count(1) from table

补充:.NET技术 ,  ASP.NET
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,