Thread: mysql gurus
View Single Post
Old 01-25-2004, 11:40 AM  
TDJ
Confirmed User
 
Join Date: Nov 2003
Location: Ontario, CA
Posts: 146
You could if you were using postgres or a brand new beta mysql version, then you can use subselects:

then i do
SELECT text,url FROM table WHERE 1 AND surl IN (SELECT DISTINCT surl FROM table WHERE text like '%something%') AND text like '%something%' LIMIT 5

Sounds like your table structure is poorly setup, else it should just be a matter of:

SELECT a.whatever FROM tableA a, tableB b WHERE b.value='$blah' and a.id=b.id

That might be too technical an explanation for you, sorry if so... Otherwise, using a 'stable' mysql release.. no.. no sub-selects.
TDJ is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote