Skip to content

Instantly share code, notes, and snippets.

@claudiohilario
Created October 24, 2016 03:16
Show Gist options
  • Save claudiohilario/0eb9f6b5a0db8502080f4a29245def83 to your computer and use it in GitHub Desktop.
Save claudiohilario/0eb9f6b5a0db8502080f4a29245def83 to your computer and use it in GitHub Desktop.
Outras Querys SQL
--Selecionar registo unico aleatório
SELECT * FROM table ORDER BY RAND() LIMIT 1
--Remover registos com mais x dias
DELETE FROM tabela WHERE date < DATE_SUB(NOW(), INTERVAL X DAY);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment