-5
有沒有人可以解釋爲什麼我的查詢不起作用?SQL內部連接vs LIKE不返回行
SELECT country.Country, city.City, location.Adress, museuminfo.Phone, museuminfo.Mail, museuminfo.Homepage, museum.MuseumName, museum.Description, museum.Collections, photo.PhotoRef FROM country INNER JOIN city ON country.CountryCode=city.CountryCode INNER JOIN location ON city.CityId = location.CityId INNER JOIN museuminfo ON location.LocationId = museuminfo.LocationId INNER JOIN museum ON museuminfo.MuseumInfoId = museum.MuseumInfoId INNER JOIN photo ON museuminfo.MuseumInfoId = photo.MuseumInfoId WHERE (MuseumName LIKE '%classic%') OR (Description LIKE '%classic%') OR (Collections LIKE '%classic%') AND museum.LanguageCode = 'EN'
我有一個縮短版的正常工作,但你只能同時搜索一個表:
SELECT * FROM museum WHERE (MuseumName LIKE '%classic%') OR (Description LIKE '%classic%') OR (Collections LIKE '%classic%') AND museum.LanguageCode = 'EN'
請幫我:-(
查詢應該做什麼? –
'INNER JOIN'在兩側產生匹配行的行。如果任何連接條件沒有匹配的行,那麼您將不會得到任何結果。嘗試使用'OUTER JOIN'或'LEFT JOIN'。 – univerio
當你有一個縮短的版本,不工作,你可以解釋你正在嘗試做什麼,出了什麼問題。 – wvdz