0
votes

I made this SELECT in Postgresql, to test what columns i need in my project, also im stuck and need help.

SELECT 
  trb.id,
  id_cliente,
  id_usuario,
  usu.nome_acesso,
  id_contribuinte,
  to_char(data_mensagem, 'MM/DD/YYYY')
  ,
  assunto,
  mensagem
FROM 
  el_trb_mensagem.trb_mensagem trb
  left join el_acesso.gg_usuario usu on (usu.id = trb.id_usuario)

The next step, is to make a INSERT, but with the basic syntax of the postgres website documentation i dont get the idea, but i think its more simple than it looks.

1

1 Answers

0
votes
insert into <destination table> (<destination columns' names>)
<your select>

e.g.

insert into table (id,name) select another_id, another_name from another_table