sqlͳ¼ÆÎÊÌ⣡
sql´úÂëÈçÏ£º
select dictcharge.no1 as no1 ,
dictcharge.name1 as name1,
patinfo.hospcode,
sum(hosp_detail_price.price) as price
from dictcharge, his_history..hosp_detail_price hosp_detail_price, dictmedi , his_history..patinfo patinfo
where dictmedi.mediid = hosp_detail_price.mediid
and dictcharge.chargeid = dictmedi.hosptype
and hosp_detail_price.hospid = patinfo.hospid
and hosp_detail_price.isprice = 1
and hosp_detail_price.ischeck = 1
and hosp_detail_price.isconfirm = 1
and hosp_detail_price.ispay <> 1
and dictcharge.name1 = 'ÊÖÊõ·Ñ'
group by dictcharge.no1, patinfo.hospcode,dictcharge.name1 ;
²éѯ½á¹ûÈçÏ£º
25 ÊÖÊõ·Ñ 20090001 700.00
25 ÊÖÊõ·Ñ 20090003 300.00
25 ÊÖÊõ·Ñ 20090004 400.00
25 ÊÖÊõ·Ñ 20090005 600.00
25 ÊÖÊõ·Ñ 20090009 1030.00
25 ÊÖÊõ·Ñ 20090011 980.00
25 ÊÖÊõ·Ñ 20090012 780.00
25 ÊÖÊõ·Ñ 20090013 460.00
25 ÊÖÊõ·Ñ 20090016 600.00
ÎÒÏëͳ¼ÆÉÏÃæsqlÓï¾ä²éѯ½á¹ûµÄÐÐÊý£¬Çë¸ßÊÖÖ¸µã¡£
SQL code:
select COUNT(*) as ÐÐÊý
from (
select dictcharge.no1 as no1 ,
dictcharge.name1 as name1,
patinfo.hospcode,
sum(hosp_detail_pri
Ïà¹ØÎÊ´ð£º
´ÓÊý¾Ý¿âÖвéѯһÕűíµÄÊý¾Ý
select ²¿ÃÅ,ÐÕÃû from tb
ÈçºÎ²ÅÄÜÉú³ÉÏÂÃæµÄxml¸ñʽ
XML code:
<folder state="unchecked" label="È«²¿">
¡¡¡¡ <folder state="unchecked&qu ......
СµÜ£¬×î½üҪתÐÐÈ¥×öoracle¿ª·¢ÁË£¬ÓÉÓÚ´óѧ±Ïҵʱ£¬×ßÁ˸öÍä·£¬ÏÖÔÚºÜСÐÄ£¬ÎÊÏ£¬×öPL/SQLÓÐûÓÐǰ;£¿£¿£¿
µ±È»ÎÒ˵µÄÕâ¸öǰ;ÊÇÖ¸ ÒÔºóÒªÌø²Û£¬Êг¡¶ÔÕâÑùµÄÈ˲ŵÄÐèÇóÁ¿´ó²»´ó£¿£¿
3q ÄÇ¿´À´»¹Ö»ÄÜÏȽӴ ......
±í
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µÄÈí¼þÔÚÄÄÀï¿ÉÒÔϰ¡£¡ÔÚÍøÉÏÕÒÁËÂù¶à¶¼Óò»Á˰¡
Ëæ±ã¸ãÒ»D°æ°É£¬
ѸÀ×µÚÒ»¸ö¾Í¿ÉÒÔÓÃ
2000,2005¶¼ÕâÑù
http://119.147.41.16/down?cid=0698C2D64D7D637D90A6D2482298E6717D4F15CD&t=2&fmt=-1 ......
ÈçºÎÔÚSQL2005ÖÐÉ趨¶¨Ê±×÷Òµ£¬±ÈÈç˵¶¨Ê±ÇåÀíijЩ±íµÄÊý¾Ý£¬
»òÕßÊǶ¨Ê±µÄ½«Ä³Ð©±íµÄÊý¾Ýµ¼³öexcel£¡
ÔÚÏߵȴý£¬¼±¼±¼±£¬×îºÃÊÇÏêϸ²½Ö裡
֮ǰÎÒ×öµÄ×÷ÒµÓеãÎÊÌ⣡
°ïUP
²Î¿¼:http://hi.baidu.com/toiota ......