|
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.
|