select count(1) from table1 这句话count里有个1是什么意思? 表的第一列..就好像 SELECT ... FORM ... ORDER BY 1 DESC; 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 CREATE TABLE `table1` ( `a` mediumint(4) NOT NULL auto_increment, `b` varchar(20) NOT NULL default '', `c` varchar(20) NOT NULL default '', `d` tinyint(2) NOT NULL default '1', `e` varchar(50) default NULL, PRIMARY KEY (`a`), UNIQUE KEY `a` (`a`)) TYPE=MyISAMselect count(1) from table1 == select count(a) from table1 !! 倏然我知道是表的第一列..但感觉用什么数字效果都是一样的!嗬嗬!mysql> desc logoff;+------------+-------------+------+-----+---------+-------+| Field | Type | Null | Key | Default | Extra |+------------+-------------+------+-----+---------+-------+| usernumber | varchar(15) | YES | MUL | NULL | |+------------+-------------+------+-----+---------+-------+1 row in set (0.41 sec)mysql> select count(1) from logoff;+----------+| count(1) |+----------+| 1461742 |+----------+1 row in set (0.03 sec)mysql> select count(1000) from logoff;+-------------+| count(1000) |+-------------+| 1461742 |+-------------+1 row in set (0.00 sec)mysql> select count(0) from logoff;+----------+| count(0) |+----------+| 1461742 |+----------+1 row in set (0.00 sec)mysql> select count(-1) from logoff;+-----------+| count(-1) |+-----------+| 1461742 |+-----------+1 row in set (0.00 sec) 呵呵,是的.就好像分组后 COUNT(*) = COUNT(Col1) 一样.参数已没有什么实际意义了. 远程客户端,mysql5.5无法启动,mysqld.exe[5540]中出现未处理的win32异常,什么情况?怎么解决? 求按部门分类统计的sql语句 sql查询 mysql如何生成随机码? (讨论)关于数据缓存 在客户端如何连接MySQL服务器 没分了.... 但求一个问题-----Mysql数据库文件还原的问题 mysql5.0(unzip版)如何安装配置? 急啊!密码不能修改,大家来看看啊~~~~~~~~~~~ 触发器问题 请教查询问题 请问哪有mysql for jdbc的driver?
`a` mediumint(4) NOT NULL auto_increment,
`b` varchar(20) NOT NULL default '',
`c` varchar(20) NOT NULL default '',
`d` tinyint(2) NOT NULL default '1',
`e` varchar(50) default NULL,
PRIMARY KEY (`a`),
UNIQUE KEY `a` (`a`)
) TYPE=MyISAMselect count(1) from table1 == select count(a) from table1 !!
+------------+-------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+------------+-------------+------+-----+---------+-------+
| usernumber | varchar(15) | YES | MUL | NULL | |
+------------+-------------+------+-----+---------+-------+
1 row in set (0.41 sec)mysql> select count(1) from logoff;
+----------+
| count(1) |
+----------+
| 1461742 |
+----------+
1 row in set (0.03 sec)mysql> select count(1000) from logoff;
+-------------+
| count(1000) |
+-------------+
| 1461742 |
+-------------+
1 row in set (0.00 sec)mysql> select count(0) from logoff;
+----------+
| count(0) |
+----------+
| 1461742 |
+----------+
1 row in set (0.00 sec)mysql> select count(-1) from logoff;
+-----------+
| count(-1) |
+-----------+
| 1461742 |
+-----------+
1 row in set (0.00 sec)
是的.就好像分组后 COUNT(*) = COUNT(Col1) 一样.
参数已没有什么实际意义了.