| ravenslay3r@gmail.com 2005-01-22, 8:56 pm |
| I'm writing two query's and SQL is misinterperting the intended order
of
operations in my "WHERE" clauses. I've tried several things but can't
get
them to work.
QUERY 1
-----------
SELECT
....
....
FROM LCP_customers INNER JOIN LCP_states
ON LCP_customers.state = LCP_states.stateID
WHERE LCP_customers.pending = '0'
AND LCP_customers.status = 'contractor'
OR LCP_customers.status = 'both'";
Is supposed to do (in psydo-code for clairity):
Where ((LCP_customers.pending == '0') && (LCP_customers.status ==
'contractor
|| LCP_customers.status == 'both'));
QUERY 2
-----------
SELECT
....
....
FROM LCP_customers INNER JOIN LCP_states
ON LCP_customers.state = LCP_states.stateID
WHERE LCP_customers.pending = '0'
AND LCP_customers.state = '$state'
AND LCP_customers.status = 'contractor'
OR 'both';
Where ((LCP_customers.pending == '0') && (LCP_customers.state =
'$state') &&
(LCP_customers.status == 'contractor || LCP_customers.status ==
'both'));
Thanks for any and all help!
RavenSlay3r
|