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

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

tab1 ×Ö¶Î:billdate,goodsid,incount,inmoney,outcount,outmoney,endprice,endcount,endamt
tab2 ×Ö¶Î:goodsid,goodskind£¨ÉÌÆ·ÀàÐÍ£©
tab3 ×Ö¶Î:goodskind£¨ÉÌÆ·ÀàÐÍ£©,kindname

½á¹û£º
µÃµ½ÉÌÆ·ÀàÐÍÔÚÒ»¶Îʱ¼äÄÚµÄÆÚ³õ½ð¶î£¬±¾ÆÚÈë¿â½ð¶î£¬±¾ÆÚ³ö¿â½ð¶î£¬±¾ÆÚ½á´æ¡£
kindname,beginmoney,insummoney,outsummoney,endsummoney


¾ßÌå×îºÃÓеãÊý¾ÝÀ´ËµÃ÷һϣ¬·ñÔò¸ã²»ÇåÄãµÄÆÚ³õÊý¾ÝÈçºÎÉú³É

SELECT a.kindname,¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­
from tab3 a
LEFT OUTER JOIN tab2 b ON a.goodskind=b.goodskind
LEFT OUTER JOIN tab1 c ON b.goodsid=c.goodsid

×Ö¶Î˵Ã÷£¿

¿´ÆðÀ´ºÜ¼òµ¥£¬µ«ÊÇÂ¥Ö÷û°ÑÎÊÌâ˵Çå³þ£¬»Ø´ð²»ÁË£¬Ö»ÄÜupÁË...

û¿´Ã÷°×



End_rbody_63326684//-->
¸Ã»Ø¸´ÓÚ2010-02-07 20:54:26±»¹ÜÀíԱɾ³ý



¶ÔÎÒÓÐÓÃ[0]
¶ª¸ö°åש[0]
ÒýÓÃ
¾Ù±¨
¹ÜÀí
TOP








happyandsad
(ÇïÌìÂäÒ¶)

µÈ¡¡¼¶£º



#6Â¥ µÃ·Ö£º0»Ø¸´ÓÚ£º2010-02-08 10:04:39


˵µÄ²»Ã÷°×
Ä㻹ÊǸøÊý¾ÝÈ»ºó¸æËß˵ҪµÃµ½É¶Êý¾ÝÀ´µÄÖ±½Óµã


Ïà¹ØÎÊ´ð£º

csvÎļþת»»³Ésqlµ¼Èëµ½Êý¾Ý¿â£¬Ã»ÓÐÊý¾ÝΪºÎ£¿

Ö´ÐеÄ˳Ðò£º
1£©Îļþä¯ÀÀ¿ò£¨Ñ¡ÔñÎļþʹÓã©
Ñ¡ÔñºÃÎļþºó
µã»÷Ò»¸öµ¼Èë°´Å¥µÄʱºò £¬°ÑÉÏÃæÉÏ´«¿òÀïµÄcsvÎļþÒÔÒ»¸öIDΪÎļþÃû£¬ÉÏ´«µ½**/**Îļþ¼ÐÏÂ
2£©¶ÁÈ¡Õâ¸öÎļþ¼ÐϵÄcsvµÄÎļþ£¬×ª»»³Ésql
3 ......

sqlת»»ÎÊÌ⣬¼±£¡ - ÉçÇøÖ§³Ö / ¡¶³ÌÐòÔ±¡·ÔÓÖ¾

select convert(varchar(50),cast(convert(numeric(18,2),1275674000000/100000000)as real))+'ÒÚ'
select cast(convert(numeric(18,2),1275674000000/100000000)as real)
ΪʲôÉÏÒ»¸öÓÃvarcharת»»ºó¾ÍÖ»±£ÁôÁËÒ ......

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

±í
id bh  
1 10
2 11
3 12 
4 15
5 16
6 22
7 25
8 26
9 27
10 28
½«bh°´Á¬Ðø·Ö¶Î³öÀ´·µ»Ø×Ö·û´®£º
10~12£¬15~16£¬22£¬25~28
SQL code:


declare @t tabl ......

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

select count(1) from FX_RETURNBOOKCHECKLIST fxreturnbo0_ where fxreturnbo0_.BOOKID='164 ' AND fxreturnbo0_.RETURNID='00025.S0000001' 
ÉÏÃæÒ»¸ö¼òµ¥µÄSQL,Ö´ÐÐʱ¼ä2.6à ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ