Hi all, I have the following query:
SELECT distinct a.aid
FROM apartments a, details d
WHERE a.aid = d.did
AND d.did in (13,25,27)
It basically joins two tables, apartments, and apartment details.
The above example is looking for an apartment that has 3 specific "details" (ie. like basement(13), gas service (25), and oil heat(27))
Is it possible to somehow return results if there are ANY matches?
Like only if 25 and 27 match...? (I think the IN would have to be replaced with -something-)
Hopefully it would return in order of number of matches, that is, I would want to see APARMENT #1 if it matched 2 or 3 things, and APARTMENT #2 second in the results if it matched only 1...
In other words, return results in the order of the number of matches...
Not sure if I'm explaining this correctly -