Ciao,
ho la seguente query che funziona bene come potete vedere da img 01
codice:
SELECT wp_posts.ID, wp_posts.post_title, pm1.meta_value as bbb, pm2.meta_value aaaaaa, pm3.meta_value curriculum
FROM wp_posts
LEFT JOIN wp_postmeta AS pm1 ON (wp_posts.ID = pm1.post_id AND pm1.meta_key='bbb')
LEFT JOIN wp_postmeta AS pm2 ON (wp_posts.ID = pm2.post_id AND pm2.meta_key='aaaaaa')
LEFT JOIN wp_postmeta AS pm3 ON (wp_posts.ID = pm3.post_id AND pm3.meta_key='curriculum')
INNER JOIN wp_term_relationships ON wp_posts.ID = wp_term_relationships.object_id
INNER JOIN wp_term_taxonomy ON wp_term_relationships.term_taxonomy_id = wp_term_taxonomy.term_taxonomy_id
INNER JOIN wp_terms ON wp_term_taxonomy.term_id = wp_terms.term_id WHERE wp_posts.post_type = 'post' AND wp_posts.post_status = 'publish
sk01.fw.jpg
Se guardate l'immagine sopra (spero si capisca) l'ultima riga ID 136 presenta come risultato curriculum 137... ed è giusto.
Io però vorrei un altro risultato (vedi immagine sotto)
sk02.fw.jpg
Se vedete la tabella sopra wp_postmeta ha 2 record, collegati fra loro.
Io vorrei, se possibile, che il risultato della query, per quanto riguarda la voce curriculum, non dasse 137 ma 2014/11/abc.docx. E' possibile?
Se possbile potreste aggiungermi il pezzo di query mancante?
Grazie mille.