Skip to content

Instantly share code, notes, and snippets.

@Cerwyn
Created May 29, 2021 00:04
Show Gist options
  • Save Cerwyn/1286a46cdf7406c5643d911a0d3c668f to your computer and use it in GitHub Desktop.
Save Cerwyn/1286a46cdf7406c5643d911a0d3c668f to your computer and use it in GitHub Desktop.
<?php
SELECT *
FROM `articles`
WHERE EXISTS (SELECT *
FROM `users`
WHERE `articles`.`user_id` = `users`.`id`
AND EXISTS (SELECT *
FROM `profiles`
WHERE `profiles`.`user_id` = `users`.`id`)
AND `users`.`deleted_at` IS NULL)
AND `verified` = '1'
AND `active` = '1'
ORDER BY `created_at` DESC
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment