Á½¸ö±í
Çë¿´ "Persons" ±í£º
name banji shunxu
yiyang 01 1
yiyang 02 1
lili 01 2
½ÓÏÂÀ´Çë¿´ "xueke" ±í£º
name kemu shunxu
yiyang 01-yingyu 1
yiyang 01-shuxue 1
yiyang 02-yingyu 1
lili 01-yuwen 2
µÚÒ»¸ö± ......
SQL code:
select i.card_id,
(select m.names from
(select rownum as r ,t.code_detail,d.names from infectiondetail t, infection_steps d where t.code_detail = d.code and t.infection_cardid = i.card_id order by t.dt_start desc,t.addtime desc) m
where m.r<2
) diseaasestageName
from infec ......
СµÜÏÖÔÚÓÐÒ»¸öÕâÑùµÄÐèÇó£¬ÔÚA±íÖÐÓÐaID£¨×ÔÔö³¤£©£¬Address(stringÀàÐÍ)£¬B±íÖÐÓÐbID£¨×ÔÔö³¤£©£¬Address(stringÀàÐÍ)
A
aID Address
1 ÉϺ£Ðû»¯Â·300ºÅ±±Ëþ2303
2 ÉϺ£Ë®³Ç·883ŪÄϲ¿µØÏ³µ¿â
B
bID Address
2 ......
СµÜÏÖÔÚÓÐÒ»¸öÕâÑùµÄÐèÇó£¬ÔÚA±íÖÐÓÐaID£¨×ÔÔö³¤£©£¬Address(stringÀàÐÍ)£¬B±íÖÐÓÐbID£¨×ÔÔö³¤£©£¬Address(stringÀàÐÍ)
A
aID Address
1 ÉϺ£Ðû»¯Â·300ºÅ±±Ëþ2303
2 ÉϺ£Ë®³Ç·883ŪÄϲ¿µØÏ³µ¿â
B
bID Address
2 ......
»·¾³£º
Microsoft SQL Server Management Studio 10.0.1600.22 ((SQL_PreRelease).080709-1414 )
Microsoft Analysis Services ¿Í»§¶Ë¹¤¾ß 2007.0100.1600.022 ((SQL_PreRelease).080709-1414 )
Microsoft Êý¾Ý·ÃÎÊ×é¼þ (MDAC) 6.1.7600.16384 (win7_rtm.090710-1945)
Microsoft MSXML 3.0 5.0 6.0
Mic ......
±íÈçÏ£º
ID Name Cid Quantity
B1 M R1 1
B1 M R3 0.2
B1 M R5 0.8
R1 M2 R4 1
R1 M2 R9 0.2
R1 M2 R12 1
ÒªÒÔÏÂÃæ½á¹û
ID Name Cid Quantity
B1 M R3 0.2
B1 M R5 0.8
B1 M R4 1
B1 M R ......