Thanks again, i've sorted the problem now (fingers crossed). I had a lot of conditions after the WHERE clause. The user can decide which is most important to them.
if you want to see what the query is for, it's used on this page:
http://lupton.bpweb.net/thelea.com/phppages/jobindex.php4
Thanks that works, however it hasn't solved my problem.
It did let me figure out what's causing it. I'm using two tables. One holds all the main info, the other is a relational table to hold multiple location info about a person.
i.e.
tblperson:
person_id
name
age
sex
dob
tblperson_location...
Didn't get a response to my last thread so i thought i'd try a simplified version.
Basically what i'm trying to do is order some results based on whether they match some criteria.
The query is of the form
SELECT distinct *, (apple='delicious' AND pear='rotten') as Relevance FROM tblfruit...
Hi,
I'm trying to sort results using sets of conditions returning either 1 or 0.
The following sql is looking at two relational tables where tbljobs.id is related to tbljob_location.job_id
SELECT distinct tbljobs.*,
(tbljobs.phase='Pre School' and tbljobs.id=tbljob_location.job_id AND...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.