ASP.net内部连接不支持错误

时间:2012-11-20 07:25:26

标签: sql join

从我看来,这应该是有效的。为什么不是我需要帮助的东西。删除AS语句会有什么好处吗?

SELECT td.Title, ti.Path, td.ImageID, ti.ImageID, td.Description 
FROM TravelImage as ti 
Inner JOIN TravelImageDetails as td ON (ti.ImageID=td.ImageID) 
AND Title LIKE '%" + @query + "%' OR Description LIKE '%" + @query + "%' 

编辑:我得到的错误是它表示不支持加入

1 个答案:

答案 0 :(得分:0)

尝试此查询, 我认为缺少哪里条件?

SELECT  td.Title, ti.Path, td.ImageID, ti.ImageID AS Expr1, td.Description
    FROM  TravelImage AS ti INNER JOIN
    TravelImageDetails AS td ON ti.ImageID = td.ImageID 
    Where  Title LIKE '%" + @query + "%' OR Description LIKE '%" + @query + "%'