This is my table. I simply would like one select statement that returns coupon_code, max_uses, and times_used. I don't know how to join it all to do that.
mysql> select * from wp_postmeta where post_id = '207717';
+---------+---------+------------------------+-------------------------------+
| meta_id | post_id | meta_key | meta_value |
+---------+---------+------------------------+-------------------------------+
| 795679 | 207717 | coupon_code | emeraldcity |
| 795689 | 207717 | max_uses | 30 |
| 795699 | 207717 | start_date | 2016-07-22 |
| 795704 | 207717 | _end_date | WPMUDEV_Field_Datepicker |
| 795705 | 207717 | _edit_lock | 1492003198:1 |
| 913311 | 207717 | times_used | 22 |
+---------+---------+------------------------+-------------------------------+
For example, this gets me just max_uses.
mysql> select * from wp_postmeta where post_id = '207717' and meta_key = 'max_uses';
+---------+---------+----------+------------+
| meta_id | post_id | meta_key | meta_value |
+---------+---------+----------+------------+
| 795689 | 207717 | max_uses | 30 |
+---------+---------+----------+------------+