Created
February 9, 2017 16:37
-
-
Save FabianoFaria/e75d44a8a4e04a390e4ecf6dc0e68229 to your computer and use it in GitHub Desktop.
Query MYSQL para seleciona a cada n° rows
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 UNIX_TIMESTAMP(dt_criacao) AS 'dt_criacao' | |
FROM ( | |
SELECT | |
@row := @row +1 AS rownum, dt_criacao | |
FROM ( | |
SELECT @row :=0) r, tb_dados WHERE num_sim = '1' AND dt_criacao BETWEEN '2017-02-01' AND '2017-02-09' | |
) ranked | |
WHERE rownum %30 =1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment