[wp-trac] Re: [WordPress Trac] #9167: query_posts('meta_key=foo') returns duplicate posts

WordPress Trac wp-trac at lists.automattic.com
Wed Feb 18 22:55:30 GMT 2009


#9167: query_posts('meta_key=foo') returns duplicate posts
--------------------------+-------------------------------------------------
 Reporter:  scribu        |       Owner:  anonymous
     Type:  defect (bug)  |      Status:  new      
 Priority:  normal        |   Milestone:  2.7.2    
Component:  General       |     Version:           
 Severity:  normal        |    Keywords:           
--------------------------+-------------------------------------------------
Changes (by scribu):

 * cc: scribu@… (added)


Comment:

 Can't this be solved by simply using "SELECT DISTINCT(wp_posts.ID)..." on
 all queries? I can't think of a situation where you ''would'' want
 duplicate posts.

 PS: The subquery method is exatly what I use on a plugin to filter posts
 based on multiple meta key=>value pairs.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/9167#comment:2>
WordPress Trac <http://trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list