Bom dia, pessoal. Tenho uma tabela assim:

id_hor           descricao_hor
   1                      07:30
   2                      08:20
   3                      09:10
   4                      10:15
   5                      11:05
   6                      11:55

Tablela Agenda - Relacionada com horarios através de idhora_ag:

id_ag data_ag professor_ag turma_ag recurso_ag idhora_ag 1 01/02/2016 Prof A Turma 1 Lab 1 2 01/02/2016 Prof B Turma 2 Tab 2 3 01/02/2016 Prof C Turma 3 Lab 3 4 01/02/2016 Prof D Turma 4 Tab 4 5 01/02/2016 Prof E Turma 5 Lab 5 6 01/02/2016 Prof F Turma 6 Tab 6

Preciso montar um select de acordo com a data retornando:
DESCRICAO_HOR                     LAB              TAB
         07:30                             Prof A
         08:20                                                  Prof B
         09:10                             Prof C
         10:15 Prof D
         11:05                              Prof E
         11:55 Prof E
Pesquisando acho que é com crosstab, mas ainda não sei como proceder.

[]´s

Stclara.
_______________________________________________
pgbr-geral mailing list
pgbr-geral@listas.postgresql.org.br
https://listas.postgresql.org.br/cgi-bin/mailman/listinfo/pgbr-geral

Responder a