[wp-hackers] Re: [ slow queries in 1.2

Tor Bjornrud bjornrud at msu.edu
Fri Nov 19 15:01:31 UTC 2004


Owen Winkler wrote:
>>
> Forgive me for butting in where I have no practical experience 
> (WordPress query optimization), but isn't there a way to JOIN in MySQL?  
> Isn't that the kind of query that we're talking about?

I don't know the actual JOIN keyword syntax, but grabbing a bunch of 
data from multiple tables is no sweat.

SELECT DISTINCT table1.data FROM table1, table2 WHERE 
table2.id=table1.id AND table2.realfield='whatyouweresearchingby';

To add more tables, just make you add the tablename to the FROM area, 
and relate table records by keys that match up.

I do know that a lot of the more complex JOIN syntax isn't available to 
users with MySQL beneath version 4.0

~Tor



More information about the hackers mailing list