ChinaUnix.net
相关文章推荐:

select count getInt

select a , count(*) FROM (select * from STUDENT ) GROUP BY a 这个语句,在ACCESS中可以运行, 但是在SQL SERVER中,就报错。 怎么改呢? 谢谢大家。

by samyp1234 - MySQL - 2006-05-05 23:58:35 阅读(1153) 回复(1)

相关讨论

mysql> select count(id) from post; +-----------+ | count(id) | +-----------+ | 18836 | +-----------+ 1 row in set (1.06 sec) 我的怎么慢得要死 innodb数据库 服务器配置 P4 3.0 1G 服务器基本上没有什么访问量 是innodb的问题 在select 前先运行 set autocommit=0 再select count() from t 速度是慢 转换成myisam速度马上提上去了 mysql> select count(*) f +----------+ | count(*) | +----------+ | 18836 | +-...

by YourEyes - MySQL - 2014-05-20 11:10:43 阅读(16723) 回复(14)

请问select count(*) 与select count(1)有什么区别? 我比较过 好象没什么分别

by taker2001 - Sybase - 2007-05-23 11:07:40 阅读(3224) 回复(2)

为什么 select count(fieldName) 比select count(*)慢很多? 根据set explain on看cost 发现select count(*)比select count(fieldName)要快很多,不知道是什么原因?请高手指教。

by paza - Informix - 2004-09-06 17:47:31 阅读(1844) 回复(7)

命令格式:SQL> select count(*) from table name where field name like "XX"; 结果没有任何信息返回,请看附件。 为什么?

by flyablepigjia - Oracle - 2008-04-03 11:40:39 阅读(1750) 回复(0)

为什么“Innodb表,尽量不执行select count(*) 语句”?有多大影响? 谢谢!

by linuxkumao - MySQL - 2008-02-28 18:48:41 阅读(2224) 回复(3)

以下是我的select 语句: select count(*) from (select a.dw as dw,a.gr as gr,b.zt as zt,nvl((select sum(sr) from tablea),0)-nvl((select sum(zc) from tablea),0) as amt from a,b where a.list=b.list) where dw='1' and amt>0 上面的语句计算出的结果为10000 然后把select count(*) 改为select *其他条件都不变,结果出来的记录条数是8500。 经查当select count(*) 的时候,好像是amt>0这个条件没有起作用。 不知道什么...

by my_etimes - Oracle - 2006-09-14 08:07:28 阅读(978) 回复(0)

[quote] 1> select 2> count (*) 3> from exchg where inbank like '1024210 4> 00018%' and (recverserial between 0 and 99999999) 5> and dcflag like '2%' and printflag like '1%' order by recverserial 6> go ----------- 0 0 (2 rows affected) [/quote]为什么是这样的?不是只有一个结果的吗?

by THEBEST - Sybase - 2006-01-05 11:52:31 阅读(1146) 回复(1)
by shaoxia - Oracle - 2006-12-13 17:50:32 阅读(8629) 回复(11)

select count(*) from (select distinct field1 from TAB1) 上面的查询中TAB1.field1建有索引,因此理论上数据库应该检索索引,提高效率。 但是在informix 中无论怎样调整,都是SEQUENTIAL SCAN 实际运行时,TAB1有1000万条记录,在Informix中需要3分钟运行,还是unix服务器。 但是在Oracle数据库,自己的ibm笔记本电脑,不用特别优化,同样的数据,只需要7秒。 这个差别也太大了,可以说是为什么informix没落的原因,至少我是不...

by midea0978 - Informix - 2009-06-11 16:12:57 阅读(4774) 回复(9)

select count(*) from tablea"); /* 使用 OCIDefineByName 要在执行 OCIExecute 前 */ OCIDefineByName($stmt,"EMPNO",&$count(*) ); OCIExecute($stmt); while (OCIFetch($stmt)) { echo "$EMPNO"; } OCIFreeStatement($stmt); OC...

by danmar - PHP - 2007-07-03 11:54:38 阅读(2428) 回复(1)