SQLå¤ä¸ªè¡¨å®ç°èåæ¥è¯¢
select LineId,Id,Country from Domestic
union all
select LineId,Id,Country from Freedom
-- èåæ¥è¯¢Domestic,Freedom表çLineId,Id,Country all代表ä¸å»é¤åå¤
--åè½ï¼[SQLè¯å¥] UNION [SQLè¯å¥]å°ä¸¤ä¸ªè¯å¥ä¸éæ©çåä¸åä¸çä¸åçå¼çéåºæ¥
SELECT<表1>.<åå> ,<表2><åå>FROM<表1>OUTER JOIN<表2> ON<表1>.<å>=表2>.<åå>
--åè½ï¼å®ç°ä¸¤ä¸ªè¡¨çå¤è¿æ¥
Select Domestic.LineId,Freedom.LineId from Domestic,Freedom where Domestic.Sames=Freedom.Sames
Select Domestic.LineId,Freedom.LineId FROM Domestic inner join Freedom on Freedom.Sames=Domestic.Sames
--åè½ï¼å®ç°ä¸¤ä¸ªè¡¨çå
è¿æ¥ æDomestic,Freedom两个表ç¨Domestic.Sames=Freedom.Sameså
³èèµ·æ¥æ¾ç¤ºDomestic.LineId,Freedom.LineId
------------------------
æçæ°æ®åºè¡¨æ¯è¿ç§:table0101,table0102,table0103,.......å个表æåæ ·çç»æ,ææ³ç¨sqlè¯å¥ä»æ¥è¯¢åæå¨é导åºæ¥,æ没æåæ³è½å¤ä¸æ¬¡å¯¼åº,è¯å¥è¦è¿åä¸ä¸ªç»æé.
ç¨union allå°±è½å¤å®ç°ï¼
select * from table0101
union all
select * from table0102
union all
select * from table0103
union all
select * from table0104
....
温馨提示:内容为网友见解,仅供参考