Skip to content

Instantly share code, notes, and snippets.

@viniciusss
Created June 7, 2013 13:22
Show Gist options
  • Save viniciusss/5729217 to your computer and use it in GitHub Desktop.
Save viniciusss/5729217 to your computer and use it in GitHub Desktop.
SELECT tbl.*,
IF( tbl.administrador = 1, 'Administrador', IF( tbl.aluno 1, 'Aluno', 'Professor' ) ) AS tipo_usuario
FROM(
SELECT u.*,
EXISTS(
SELECT 'X'
FROM aluno
) as aluno
) as tbl
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment