Ò׽ؽØÍ¼Èí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

¹ØÓÚ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ÖеÄÓï¾ä£¬ÔËÐÐʱ£¬ÀÏÊDZ¨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+ASP

....½Óµ½Ò»¸öС³ÌÐò..¹¤×÷Ô­À´´ó¸ÅÊÇÕâÑùµÄ...ǰ̨ÊÇWEB·þÎñÆ÷.¼Ü¹¹¾ÍÊÇASP+SQL..ǰ̨ÓÉASPÏòSQLÌí¼Ó·þÎñÀà±ð(±íµ¥).È»ºóÓÖºǫ́³ÌÐò¶ÁÈ¡±íµ¥..Ҫʵʱ¶ÁÈ¡..È»ºóÏÔʾÔÚ·þÎñÆ÷ÉÏÃæ..´ÓÀíÂÛÉÏÃæÄÜÐÐͨ²»?Èç¹û¿ÉÒÔ..ºǫ́ ......

ÓÐÈËÓùýsql server2005 ´´½¨·¢²¼Âð£¿

¾ÍÊÇÕ¹¿ªreplication ÓÒ¼üµ¥»÷ local Subscription ´´½¨·¢²¼£¬ ÓÐÈËÓùýÂ𣬳ɹ¦´´½¨·¢²¼µÄÓÐÂð£¿
Óùý£¬¿ÉÒԳɹ¦

ÒýÓÃ
Óùý£¬¿ÉÒԳɹ¦

Ã×ÓùýµÄ°ï¶¥

ÒýÓÃ
Óùý£¬¿ÉÒԳɹ¦

µÚÒ»²½ÎҾ͹ý² ......

sqlÁ½Áкϲ¢ÏÔʾ£¿

²éѯ½á¹û¼¯£º
ps  online  totle
a    0      10
b    1      11
c    5        8
ÏëÏÔʾ³ÉÕâÑù ......

sql ´æ´¢¹ý³Ì ¶¯Ì¬±í DateTimeÊý¾ÝÀàÐÍ Ìí¼ÓÎÊÌâ

ÎÒµÄÊý¾Ý¿âµÄ±íÊǶ¯Ì¬µÄ±í,ÔÚÌí¼ÓÊý¾ÝµÄʱºòÓÐÒ»¸ö×Ö¶ÎÊÇDATETIMEÊý¾ÝÀàÐ͵Ä,ÏÂÃæÊÇ´æ´¢¹ý³Ì
if exists (select * from sysobjects where name='proc_ADD_Order')
drop proc proc_ADD_Order
go
......

sql×Ö·û´®Ìæ»»(ÓеãÌôÕ½···)

±ÈÈç ÓÐÒ»×Ö¶ÎΪ£º
Num
6111
6201
6520
65121
60087
46300

ÎÒÏë°Ñ6¿ªÍ·µÄÈ«¶¼Ìæ»»³É5¿ªÍ·

×¢ÒâÕâÊDZíÀïµÄÊý¾Ý£¬ÎÒÏëÓÃSQLÓï¾äʵÏÖÌæ»»
SQL code:
update tb set
num = s ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ