¡¾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='' ÏȽáÌûÔÙÊÔ°É ¶¼ÒªÐ´Â𣿠ÎÒÓÖ¶àÕűí 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='»áÔ±' TÊÇ