Skip to content

Instantly share code, notes, and snippets.

@fernandopetry
Last active November 28, 2017 17:50
Show Gist options
  • Save fernandopetry/f6efef3e815273a4cf3a8b1152cbd4ba to your computer and use it in GitHub Desktop.
Save fernandopetry/f6efef3e815273a4cf3a8b1152cbd4ba to your computer and use it in GitHub Desktop.
SELECT name, email, status FROM pessoa WHERE EXISTS (SELECT nome, email FROM usuario)
$regex = '\(SELECT)\s.*?(FROM)\';
$replace = ' $1 count(1) as total $2';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment