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

¡¾SOS¡¿ MSSQLÊý¾Ý¿âÎÊÌâ - MS-SQL Server / ÒÉÄÑÎÊÌâ

select id,name,type from A union all 
select id,name,type from B union all 
select id,name,type from C union all where ???
----------------------------------------------------
 1,ÕÅÈý,»áÔ±
 2,ÀîËÄ,×êʯ
 7,ÍõÎå,ÆÕͨ
 3,ÕÅÈý,»áÔ±
 5,ÕÅÈý,»áÔ±
---------------------------------------
 ²éѯʱ ¡°»áÔ±¡± µÄÓû§ÁР
  Where ºóÃæÔõôд¡£¡£¡£
  type='»áÔ±' ²»ÐÐ


³É¹¦ºó ¼´½áÌù¡£¡£¡£¡£¡£¡£¡£¡£¡£¡£¡£¡£¡£

A.type = '' or B.type='' or C.type=''


ÏȽáÌûÔÙÊÔ°É

ÒýÓÃ
A.type = '' or B.type='' or C.type=''

  ¶¼ÒªÐ´Âð£¿
  ÎÒÓÖ¶àÕűí

SQL code:
select id,name,type from A where [TYPE]='»áÔ±'
union all
select id,name,type from B where [TYPE]='»áÔ±'
union all
select id,name,type from C where [TYPE]='»áÔ±'


select * from(
select id,name,type from A union all  
select id,name,type from B union all  
select id,name,type from C) t where type='»áÔ±'

ÒýÓÃ
SQL code
SELECT * from (
select id,name,type from A union all
select id,name,type from B union all
select id,name,type from C
)T where [TYPE]='»áÔ±'

  TÊÇ


Ïà¹ØÎÊ´ð£º

Çë½ÌsqlÓï¾ä¡£ - Oracle / ¿ª·¢

ÎÒÓÐÒ»¸ö±í£¬½á¹¹ÊÇÕâÑù¡£
  ת³ö µ¥Î» תÈ뵥λ ±ÊÊý ½ð¶î
date(Ö÷) outid(Ö÷) inid(Ö÷) num amt
2009 1 2 1 500 Ϊ 1 µ¥Î» ÔÚ2009Ä ......

sqlССµÄÒÉÎÊ - .NET¼¼Êõ / C#

¿ÉÄÜÒòΪ¹¤×÷µÄÔ­Òò ½Ó´¥Êý¾Ý¿âÕâ¿é±È½ÏÉÙ£¬Ö®Ç°¶¼ÊÇ×ö³ÌÐòÕâ¿é£¬Êý¾Ý¿âÕâ¿é¶¼ÓÐרÃŵÄÈËÀ´×ö ·Ö¹¤¶¼ºÜÃ÷ϸ ËùÒÔ¶ÔÊý¾Ý¿âÕâÒ»¿éÍêÈ«²»Á˽⡣ǰ¶Îʱ¼ä È¥ÃæÊÔÁ˼¸¼Ò¹«Ë¾ ¼¸ºõ¶¼ÊÇÔÚÊý¾Ý¿âÕâ¿é¹ÒµôµÄ Á¬¸ö¼òµ¥µÄSQ ......

oracle ÈçºÎµ÷ÓÃmssql´æ´¢¹ý³Ì - Oracle / ¸ß¼¶¼¼Êõ

oracle ͨ¹ýBDlink Á¬½Óµ½Ò»Ì¨MS SQL,²éѯ¶¼¿ÉÒÔ,µ«ÊDz»ÖªµÀÈçºÎÔÚoracleͨ¹ýDBLinkµ÷ÓÃMS SQLµÄ´æ´¢¹ý³Ì,Çó½â~лл~
ÒýÓÃ
oracle ͨ¹ýBDlink Á¬½Óµ½Ò»Ì¨MS SQL,²éѯ¶¼¿ÉÒÔ,µ«ÊDz»ÖªµÀÈçºÎÔÚoracleͨ¹ýDBLinkµ÷ÓÃM ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ