Created
June 21, 2017 15:20
-
-
Save LeandroLS/b906cc03e04df309ce9bc252a540e460 to your computer and use it in GitHub Desktop.
Gist post indices-mysql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT | |
*, | |
(SELECT | |
COUNT(l2.data_de_lancamento) | |
FROM | |
livros AS l2 | |
WHERE | |
l2.data_de_lancamento = l.data_de_lancamento) AS vendas_anteriores | |
FROM | |
livros AS l; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment