Skip to content

Instantly share code, notes, and snippets.

@ubiratanlima
Last active April 11, 2017 17:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ubiratanlima/c8eeb025cb554d5b0abaf6074ca77359 to your computer and use it in GitHub Desktop.
Save ubiratanlima/c8eeb025cb554d5b0abaf6074ca77359 to your computer and use it in GitHub Desktop.
QUERY("SELECT a.id, a.membro_id, a.cargosgrupo_id, pmais, pmenos, obsmsg, grupo_id, b.nivel
(SELECT nome from cargosgrupo where id = a.cargosgrupo_id) as nome_area,
(SELECT nome from usuario where id = a.membro_id) as nome_membro,
(SELECT nome from grupo where id = b.grupo_id) as nome_grupo,
SUM(pmais) AS totalPmais, SUM(pmenos) AS totalPmenos,
(SUM(pmais)-SUM(pmenos)) as percentual
FROM pontuacao a
INNER JOIN usuario b
ON a.membro_id = b.id
Where b.grupo_id = ".base64_decode($_SESSION['GRUPOID'])."
GROUP BY a.membro_id ORDER BY nome_membro ASC");
@ubiratanlima
Copy link
Author

Preciso colocar mais um filtro onde o campo nivel contém o valor CONVIDADO.
Todos CONVIDADO deve ser excluido dessa query

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment