Hi
my problem is about query. I have 3 tables : Models,Languages and ModelsLanuages.
in search form user clicks languages and the result should be with the way user want. What i cant do is when user picks English and German, the result should be models who knows English and German. If model knows German but doesnt know English, it shouldnt be on the result.But in my case, it comes to the result.This is where i have trouble
md.LanguagesID=1 and md.LanguagesID=3 it is not working...
select
* from Models m join ModelsLanguage md on md.ModelID=m.ModelID join Languages d on d.LanguagesID=md.LanguagesID where (m.Yasi between 0 and 99 ) and (m.AyakkabiNo between 0 and 50 ) and md.LanguagesID=1 and md.LanguagesID=3Thanks...

Blocked AccountRank #403 · 6.2K reputationPosted Mar 26, 2008, 9:09 PM EDT
Write your query like that.
select * from Models m join ModelsLanguage md on md.ModelID=m.ModelID join Languages d on d.LanguagesID=md.LanguagesID where (m.Yasi between 0 and 99 ) and (m.AyakkabiNo between 0 and 50 ) and (md.LanguagesID=1 OR md.LanguagesID=3)
yusuf57 reputationPosted Mar 27, 2008, 1:45 AM EDT
Thanks for your response Manish.
For Example English ID 1 German ID 3...
If i write like that, if Model knows 1 and doesnt know 3, that models comes in the result. But it shouldnt appear if it doesnt know just one of them, it should not be apper in the result.
The result should show just Models who know 1 and 3....