2009/11/26 Tim Starling <[email protected]>: > Don't use subselects, they're not supported by MySQL 4.0 which is what > we target. > > $dbr = wfGetDB( DB_SLAVE ); > > $max = $dbr->selectField( > 'recentchanges', > 'max(rc_id)', > false, > __METHOD__, > array( 'GROUP BY' => 'rc_title' ); > > $res = $dbr->select( > 'recentchanges', > '*', > array( > 'rc_id' => $max, > 'rc_namespace' => 0, > 'rc_title' => 'Wiki', > ), > __METHOD__ ); > Note that the GROUP BY condition in the first query is unnecessary, and that the whole thing could be rewritten to SELECT * FROM recentchanges WHERE rc_namespace=0 AND rc_title='Wiki' ORDER BY rc_id DESC LIMIT 1;
Roan Kattouw (Catrope) _______________________________________________ Wikitech-l mailing list [email protected] https://lists.wikimedia.org/mailman/listinfo/wikitech-l
