[wp-trac] [WordPress Trac] #17065: Independent ASC/DESC in multiple ORDER BY statement.

WordPress Trac wp-trac at lists.automattic.com
Tue Dec 6 12:01:28 UTC 2011


#17065: Independent ASC/DESC in multiple ORDER BY statement.
-------------------------------------+------------------------------
 Reporter:  ericmann                 |       Owner:  ericmann
     Type:  feature request          |      Status:  new
 Priority:  normal                   |   Milestone:  Awaiting Review
Component:  Query                    |     Version:  3.1
 Severity:  normal                   |  Resolution:
 Keywords:  has-patch needs-testing  |
-------------------------------------+------------------------------
Changes (by rosariobocca):

 * cc: rosariobocca (added)
 * type:  enhancement => feature request


Comment:

 hello,
  Only you can help me!

  I would like to sort by meta_key "st_date" asc and "st_time" asc.

  but currently I can only order it for "st_date" asc

  here is the query



 {{{
 $args = array('tax_query' => array(array('taxonomy' =>
 'eventcategory','field' => 'slug','terms' => array( 'proiezioni',
 'incontri'))), 'meta_query'=>array('relation'=>'AND',
 array('key'=>'st_date','value'=>$roxy2,'type'=>'date','compare'=>'<='),
 array('key'=>'end_date','value'=>$roxy,'type'=>'date','compare'=>'>=')),
 'post_type'=>'event', 'showposts'=>60, 'post_status'=>'publish',
 'orderby'=>'meta_value', 'meta_key'=>'st_date', 'order'=>'asc');
 }}}

 I hope in your suggestion.

  Thanks to all

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


More information about the wp-trac mailing list