Friday, February 10, 2023
HomeWordPress Developmentsql - How do I be a part of publish and postmeta...

sql – How do I be a part of publish and postmeta twice?


I am attempting to affix the next tables

postmeta

meta_id post_id meta_key meta_value
1 5000 _team_id 10000
2 10000 _enddate 2024-00-00

posts

ID post_title
10000 Group Title

Presently, I am utilizing the next question

SELECT post_id, meta_key, meta_value, post_title
FROM postmeta
INNER JOIN posts ON meta_value = ID AND meta_key = '_team_id' 
GROUP BY posts.post_author

I get the next:

post_id meta_key meta_value post_title
5000 _team_id 10000 Group Title

How do I add the second meta_value, utilizing the earlier meta_value because the id? In order that I get the next…

post_id meta_key meta_value post_title _enddate
5000 _team_id 10000 Group Title 2024-00-00

Any assist can be very grateful.

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisment -
Google search engine

Most Popular

Recent Comments