Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö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ÊÇ


Ïà¹ØÎÊ´ð£º

MS SQL×÷ÒµÎÊÌâ - MS-SQL Server / Ó¦ÓÃʵÀý

ÈçºÎÔÚSQL2005ÖÐÉ趨¶¨Ê±×÷Òµ£¬±ÈÈç˵¶¨Ê±ÇåÀíijЩ±íµÄÊý¾Ý£¬
»òÕßÊǶ¨Ê±µÄ½«Ä³Ð©±íµÄÊý¾Ýµ¼³öexcel£¡
ÔÚÏߵȴý£¬¼±¼±¼±£¬×îºÃÊÇÏêϸ²½Ö裡
֮ǰÎÒ×öµÄ×÷ÒµÓеãÎÊÌ⣡
°ïUP

²Î¿¼:http://hi.baidu.com/toiota ......

phpÁ¬½ÓMSSQL Á¬²»ÉÏ - PHP / »ù´¡±à³Ì

Warning: odbc_connect() [function.odbc-connect]: SQL error: [Microsoft][ODBC Çý¶¯³ÌÐò¹ÜÀíÆ÷] δ·¢ÏÖÊý¾ÝÔ´Ãû³Æ²¢ÇÒδָ¶¨Ä¬ÈÏÇý¶¯³ÌÐò, SQL state IM002 in SQLConnect in D:\0\msc\msc\tel.php on line 44
Í ......

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ºÅ