Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- select
- ficha_atendimento_dentista.id,
- ficha_atendimento_dentista.localDeAtendimento,
- ficha_atendimento_dentista.tipoAtendimento,
- ficha_atendimento_dentista.turno,
- profissionais_ab.cns cns_medico,
- profissionais_ab.cbo,
- unidade_ab.nome
- from
- ficha_atendimento_dentista_procedimento
- join ficha_atendimento_dentista on ficha_atendimento_dentista.id = ficha_atendimento_dentista_procedimento.codigoFicha
- join profissionais_ab on profissionais_ab.id = ficha_atendimento_dentista.profissional_id
- join unidade_ab on unidade_ab.id = profissionais_ab.unidade_id
- where ficha_atendimento_dentista.atendido = 1
- and ficha_atendimento_dentista.data >= '2019-04-01'
- and ficha_atendimento_dentista.data <= '2019-04-10'
- group by codigoFicha
- order by codigoFicha
- 1 | 1 | 1 | 1 | 123456 | DENTISTA 1 | UNIDADE 1
- 2 | 1 | 1 | 1 | 123456 | DENTISTA 1 | UNIDADE 1
- 1 | DENTISTA 1 | DENTISTA | 123456 | 1
- 2 | DENTISTA 2 | DENTISTA | 789012 | 2
- 3 | DENTISTA 3 | DENTISTA | 345678 | 3
- 4 | AUXILIAR 1 | AUXILIAR | 901234 | 1
- 5 | AUXILIAR 2 | AUXILIAR | 567890 | 2
- 6 | AUXILIAR 3 | AUXILIAR | 234567 | 3
- 1 | 1 | 1 | 1 | 123456 | DENTISTA 1 | UNIDADE 1 | AUXILIAR 1
- 2 | 1 | 1 | 1 | 123456 | DENTISTA 2 | UNIDADE 2 | AUXILIAR 2
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement