Created
July 15, 2021 17:12
-
-
Save gubleo/9f9811fdb8afa272537a59a406830458 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
select moradores.nome, unidades.unidade, unidades.bloco, reserva_academia.* | |
from acesso.reserva_academia | |
join condominio.moradores on reserva_academia.autenticacao = moradores.autenticacao | |
join condominio.unidades on moradores.condominio = unidades.condominio and moradores.bloco = unidades.bloco and moradores.andar = unidades.andar and moradores.unidade = unidades.num | |
where data::date = current_date and reserva_academia.situacao = 'reservado' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
select moradores.nome, unidades.unidade, unidades.bloco, reserva_academia.*
from acesso.reserva_academia
where data::date between '2021-01-01' and current_date
and reserva_academia.local = 'ac'