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

Çë½Ì£ºSQLÓï¾ä

ÓÐÈçϼ¸Ìõ¼Ç¼£¬¼Ç¼ͬһ¸öÉÌÆ·Óɲ»Í¬¹©Ó¦ÉÌÔÚ²»Í¬Ê±ÆÚµÄ½ø»õ¼Û¸ñ,DATE×ֶδú±íµÄÊǽø»õ¼Û¸ñÆðʼÈÕ£º

table½á¹¹ÈçÏ£º
date price vendor
20100101 10.00 A
20100321 12.00 A
20100425 9.00 A
20100209 10.00 B

½ñÌìÊÇ4ÔÂ2ÈÕ£¬ÎÒÈçºÎÄÜÈ¡µ½Ä¿Ç°¸÷¸ö¹©Ó¦É̵Ľø»õ¼Û¸ñÄØ?
20100209 10.00 B
20100321 12.00 A

лл¸÷λÀ²~~
select * from table a,(select max(date),vendor group by vendor) b
where a.date=b.date and a.vendor=b.vendor



select * from table a
where not exists (select 1 from table b where a.v=b.v and a.d<b.d)


Â¥ÉϵÄÃ²ËÆ¶¼¿ÉÒÔ··

ÒýÓÃ
Â¥ÉϵÄÃ²ËÆ¶¼¿ÉÒÔ··


Ҳллcodearts¡£½áÌùʱ·ÖÒѾ­ËÍÍêÁË~~~~




Ïà¹ØÎÊ´ð£º

jspÁ´½Ósql2000µÄÒÉÎÊ£¿



type Exception report


message

description The server encountered an internal error () that prevented it from fulfilling this request.

exception

org.apache.jas ......

sqlÓÅ»¯ - Oracle / »ù´¡ºÍ¹ÜÀí

select count(1) from FX_RETURNBOOKCHECKLIST fxreturnbo0_ where fxreturnbo0_.BOOKID='164 ' AND fxreturnbo0_.RETURNID='00025.S0000001' 
ÉÏÃæÒ»¸ö¼òµ¥µÄSQL,Ö´ÐÐʱ¼ä2.6à ......

ÇóÒ»SQL - MS-SQL Server / »ù´¡Àà

tab1 ×Ö¶Î:billdate,goodsid,incount,inmoney,outcount,outmoney,endprice,endcount,endamt
tab2 ×Ö¶Î:goodsid,goodskind£¨ÉÌÆ·ÀàÐÍ£©
tab3 ×Ö¶Î:goodskind£¨ÉÌÆ·ÀàÐÍ£©,kindname
½á¹û£º
µÃµ½ÉÌÆ·ÀàÐÍÔÚÒ»¶Îʱ¼ä ......

ÇóÒ»¸öSQLÓï¾ä - MS-SQL Server / »ù´¡Àà

×Ö¶Î1,×Ö¶Î2.....×Ö¶ÎN,Status,ParentID
1,Name1....test1,1,99
1,Name1....test1,3,99
1,Name2....test2,1,101
1,Name2....test2,3,101
1,Name3....test3,2,101
1,Name1....test1,4,101
ÏëÒªµÄ½á¹ûÊÇ:
1,Na ......

Á½¾äSQL²¢Ò»¾ä,ÓÐÎÊÌâ. - MS-SQL Server / »ù´¡Àà

µÚÒ»¾ä:
select ht.gfdm,gfdm.gfmc,gfdm.lb ,sum(jh.htdj*jh.htsl)as je
from ht left join gfdm on ht.gfdm=gfdm.gfdm 
 join jh on ht.htbh=jh.hth 
and ht.htbh not like'del%' and ht. ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ