Andy
I am building a user search engine. Now I do not know how to gett
following:
a mandatory field and a voluntary field
For example I would like to get all female users and those who are from
canada.
The results should show all users who are female regardless of nationality
But it
Andy
== relevance ??
... or define a calculated field for these relevance... and order the
results by this value...
SELECT (sex = 1 AND country = 'CA') AS relevance, sex, country
FROM table
WHERE sex = 1
ORDER BY 1 DESC
... note the relevance includes all the fields... and the
Jason
SELECT * FROM TABLE
WHERE sex = 1 OR country = 'CA';
Will select all users who are female as well as all users from Canada. You
may get duplicate records (for people who are female and from Canada) so
you
may want to use DISTINCT as well.
ok... you are right... but this error