4
I have the tables:
+----------Tabela-1--------+
id | nome | cnpj | qtd1
1 | carlos | 0563233 | 4
+--------------------------+
+----------Tabela-2--------+
id | nome | cnpj | qtd2
1 | carlos | 0563233 | 6
+--------------------------+
+----------Tabela-3--------+
id | nome | cnpj | qtd3
1 | carlos | 0563233 | 8
+--------------------------+
I would like to make an sql command to generate a single table by placing columns with different names on one side of the other, for example:
+------------------------------------------------------------------+
id | nome | cnpj | qtd1 | qtd2 | qtd3
1 | carlos | 0563233 | 4 | 6 | 8
+------------------------------------------------------------------+
Can someone please help me?
What have you tried? Post a snippet of SQL that you were trying to use
– Marciano.Andrade
I have tried to select from each table and then use Union to join, only it does not show the different columns.
– TGO