关于group by的sql语句?
with adod_dict do
begin
close;
commandtext:='select bgqxcode,count(*) wjsl from wscl_wsda_file where wjnd=:tnd group by bgqxcode';
parameters[0].DataType:=ftstring;
parameters[0].Value:=trim(cbtjnd.Text);
open;
end;
以上是delphi中的语句,运行时,老是报ora-00979 不是 group by 表达式?
ORA-00979 not a GROUP BY expression
Cause: The GROUP BY clause does not contain all the expressions in the SELECT clause. SELECT expressions that are not included in a group function, such as AVG, COUNT, MAX, MIN, SUM, STDDEV, or VARIANCE, must be listed in the GROUP BY clause.
Action: Include in the GROUP BY clause all SELECT expressions that are not group function arguments.
若是改为select bgqxcode,count(*) wjsl from wscl_wsda_file where wjnd‘2004’group by bgqxcode 在 sql plus 中能正常运行
"带有 group by 子句的查询中的 select 字段列表中,除了包含在 group by 中的字段,其他字段都要求作为 group function (比如 AVG, COUNT, MAX, MIN, SUM )的参数出现,你的子查询违作为主查询的一个字段违反了这个规则了。"
若是改为select bgqxcode,count(*) wjsl from wscl_wsda_file where wjnd='2004' group by bgqxcode 在 sql plus 中能正常运行
bobo_916 能帮我改下这条SQL语句吗?谢谢
语句本身没有问题
试试用d
相关问答:
sql语句:
select loan_plan_id,l_collect_plan.loan_id,l_collect_detail.collect_isfinished from l_collect_plan
left join l_collect_detail on l_collect_plan.return_times=l_collect_detail.collect_vo ......
数据库某表,想将其中f1,f2两个字段的内容翻10倍,请教如何写法?
update tbl set f1= f1*10,f2= f2*10 where id=10451
这种写法会造成plsql卡死
不会吧,那个id=10451 的数据有多少啊~~~~
我估计sql是不 ......
是不是只能在执行存储过程之前替换掉敏感字符了?
应该是的,可以用正则去替换
引用
应该是的,可以用正则去替换
得寸进尺的问下,除了替换单引号,还需要替换哪些呢?谢谢~
C# code:
我自 ......
各位大侠,我有一个xml文件
XML code:
<?xml version="1.0" encoding="GB2312"?>
<FileId fileid="86">
<ResultSet>
<row id="0">
......
字段aa,共有178个数据,显示时是一列直排下来的,我想让这178个数据,每列只显示5个,多列显示完,如何实现?
加一个IDENTITYT列,按ID%5来分
引用
加一个IDENTITYT列,按ID%5来分
ID-1/5来分
SQL co ......