 <p>I finally found the answer myself.</p> <p>It is possible to query the "like" table using the comment "xid" as a "post_id".</p> <pre><code>SELECT post_id, user_id FROM like WHERE post_id = &lt;comment xid&gt; </code></pre>