又有难度大的SQL的select 问题,我急!急! select count(name) ct,name,age,sex from student where name='hh'group by name,age,sex 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 count() 是不能和name这些字段同时使用的,除非列出的字段是分组字段或分组计算列另外你完全没有必要用count(name)来判断是否有hh这条记录啊。你可以判断记录,select 的结果集是否为空啊。 select count(*) ct from student where name='hh'select name,age,sex from student where name='hh' select count(name) ct,name,age,sex from student where name='hh'group by name,age,sex这种方法也不是很好,没有找到记录时同样返回空记录集。还不如不考虑使用count比较好。 select a.ct,name,age,sex from (select count(name) ct from student where name='hh') a,student bwhere b.name='hh'; 一个简单的sql查询 PL/SQL问题 sql 优化 如何获取ORACLE存储过程的参数个数 oracle中使用哪种日期? 高手请进!oracle 查询 如何快速判断数据表中是否有符合某些条件的记录?? 字段IMAGE为BLOB类型,select length(image) from table,在9I中可以,但在8I中却不行,该怎么办呢? 银行的软件是如何产生用户帐号的? 谁有SQL Navigator 3的authorization key? 问一个关于sql语句查询的问题!急! 触发器问题--100份哦
where name='hh'
group by name,age,sex这种方法也不是很好,
没有找到记录时同样返回空记录集。还不如不考虑使用count比较好。
from (select count(name) ct from student where name='hh') a,student b
where b.name='hh';