title: Combining 2 logic SQL statements in 1 query
body: <p>My question is: How to combine 2 logical statements into 1 SQL query. They both have to be true individually but something true in one statement doesn't have to be in the other, for example the meta_value being greater should only be true when I'm asking for the beginning of a course, and vice versa.<br>
  This is what I have tried so far:</p>
  <pre><code>SELECT DISTINCT course_id FROM `wp_database`
  WHERE (meta_key = 'begin' AND meta_value &gt; 1604185200)
  AND (meta_key = 'end' AND meta_value &lt; 1619372800)
  </code></pre>
  <p>This is my database structure:</p>
  <pre><code>meta_id | course_id | meta_key | meta_value
  -------------------------------------------
   1      | 1         | name     | Test1
   2      | 1         | begin    | 1604230000
   3      | 1         | end      | 1604270000
   4      | 2         | name     | Test2
   5      | 2         | begin    | 1623372800
   6      | 2         | end      | 1623385800
  </code></pre>
  <p>At the moment I don't receive any output.</p>