I have this query result and I would like the second row for each id to be added as a
SELECT m.post_id,m.meta_value,p.post_title
from events_posts p
inner join events_postmeta m
on p.ID=m.post_id and p.post_type='event' and (p.post_status='publish' or p.post_status='recurring')
and(m.meta_key='address' or m.meta_key='st_date')
order by m.post_id
column.
The results right now :
post_id meta_value post_title
15 Carolina Beach Road, Wilmington, NC, United States An Art Exhibition
15 2014-02-03 An Art Exhibition
19 Dakota Street, Winnipeg, MB, Canada Weekly Karate Classes
19 2014-02-06 Weekly Karate Classes
23 Alaskan Way, Seattle, WA, United State Christmas Carnival
23 2014-02-03 Christmas Carnival
I would like it to be
post_id | meta_value| post_title
15 | Carolina Beach Road, Wilmington, NC, United States | An Art Exhibition | 2014-02-03
19 |Dakota Street, Winnipeg, MB, Canada |Weekly Karate Classes |2014-02-06
23 |Alaskan Way, Seattle, WA, United State |Christmas Carnival |2014-02-03
events_postmetatable? I assume there's a metadata name field which can be used to distinguish betweenaddressanddatemetadata which can be used as part of the join criteria to have two logical joins