Thread: Mysql query
View Single Post
Old 2005-03-23, 12:48 PM   #1
raymor
The only guys who wear Hawaiian shirts are gay guys and big fat party animals
 
Join Date: Jan 2004
Posts: 178
Send a message via ICQ to raymor
Rather than just returning it should have given you an error.
I used a non-existant table because I accidently
tried to select from just sponsors_b instead
of saying "sponsors AS sponsors_b".
Correct code is:

Code:
SELECT DISTINCT sponsors.sponsor 
FROM sponsors, sponsors AS sponsors_h,
sponsors AS sponsors_b
WHERE sponsors.keyword='vertical' AND
sponsors_h.keyword='horizontal' AND
(
   sponsors_b.keyword='small' OR
   sponsors_b.keyword='button'
) AND
sponsors.sponsor=sponsors_h.sponsor AND
sponsors_b.sponsor=sponsors.sponsor;
__________________
Ray Morris
support@bettercgi.com
Strongbox/Throttlebox & more
TXDPS #A14012
raymor is offline   Reply With Quote