0

从我查找的内容来看,这应该可以工作。为什么它不是我需要帮助的事情。删除 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 + "%' 

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

4

1 回答 1

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 + "%'
于 2012-11-20T07:50:50.320 回答