Home > Article > Backend Development > How to write compound sql in php's medoo?
<code>select * from `items` where `id` in (select `uid` where `is_test`=1) </code>
I want to check data like this, how can I write it like this in medoo?
<code>select * from `items` where `id` in (select `uid` where `is_test`=1) </code>
I want to check data like this, how can I write it like this in medoo?
<code class="php">$database->query('select * from `items` where `id` in (select `uid` where `is_test`=1)')->fetchAll();</code>
$db->select('items', '*', ['id'=>$db->select('table', 'uid', ['is_test'=>1])]) ;
The statement in your in above should be missing table? It’s almost like this, you can change it accordingly. It's best to read the official documentation, it's all there. Some of the Chinese version documents are older and have not been updated.