User1501362304 posted
Hi,
I have a simple User table with below columns.
Id, Name, Age, Height, Income, MinAge, MaxAge, MinHeight, MaxHeight, MinIncome, MaxIncome
Here first 5 columns can be considered as user's own detail and rest of the columns as user's preferences.
I want to fetch records from this table for a given user whose preferences match (columns 6 to 11) with simple values (columns 3 to 5)
So, for given user 1, his MinAge and MaxAge expectation should match with other users' Age (Age between MinAge and MaxAge) likewise for height and income.
To get this, should I first fetch preference data for given user (user 1 in above example) and store in local variables and use them in another Select statement where id is not given user id or there is some other clean and better way of doing this?
Thanks