Skip to content

Instantly share code, notes, and snippets.

@iconte
Created March 27, 2013 17:03
Show Gist options
  • Select an option

  • Save iconte/5256044 to your computer and use it in GitHub Desktop.

Select an option

Save iconte/5256044 to your computer and use it in GitHub Desktop.
sql's uteis(mysql)
SELECT DATE_FORMAT(FROM_DAYS(TO_DAYS(now()) - TO_DAYS(@dateofbirth)), '%Y') + 0;
SELECT COUNT(*) FROM calendar WHERE d BETWEEN Start AND Stop AND DAYOFWEEK(d) NOT IN(1,7) AND holiday=0;
select <campo_desejado>, count(*) from <tabela_desejada>group by <campo_desejado> having COUNT(*)>1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment