select * from 表2 inner join
(select Title +Type +SortID  Temp from 表1) as t on temp like '%ID%'

解决方案 »

  1.   

    有点小错误
    select * from 表2 inner join
    (select Title +Type +SortID  Temp from 表1) as t on temp like '%'+ID+'%'
      

  2.   


    这样就可以了!!!!
    select A.Title +A.Type +A.SortID+B.SortName   
    from news A  inner join
    sort B on A.SortID =B.id
      

  3.   

    select a.title +a.type+a.sortid+b.sortname from  news a  inner join sort b on  a.sortid like '%'+b.id+'%'
      

  4.   

    SELECT T.HB
      FROM (SELECT A.Title+A.Type+A.Intro+B.SortName AS HB
              FROM news A INNDER JOIN
                   sort B ON A.SortID=B.ID
            ) T
     WHERE T.HB LIKE '%%'
      

  5.   

    select * from 
    (
    select a.title +a.type+a.sortid+b.sortname 
    from  news a,sort b
    where 
    a.sortid=b.id 
    ) C 
    where c.name='%'+條件名+'%'
      

  6.   

    Select ISNULL(SortName,'') + ISNULL(Title,'') + ISNULL(Type,'') + ISNULL(SortID,'') As MergeFields
    From 表2 LEFT JOIN 表1 ON ID = SortID 
    Where MergeFields Like '%%'