How to create a table from inner join using SQL?
this is my query
SELECT c.ID_CLIENTE, dt.NUM_FACTURA , f.NUM_FACTURA FROM CLIENTES C
INNER JOIN FACTURA F on c.ID_CLIENTE = f.ID_CLIENTE
inner join DETALLE_FACTURA dt on dt.NUM_FACTURA = f.NUM_FACTURA
GROUP BY DT.NUM_FACTURA
Very simple, just add this before the SELECT
CREATE TABLE NEW TABLENAME
Through this special query using the into clause we create a new table with the structure defined by the select fields , and this new table will be populated by all the records returned by the query, that is, two steps are done in one: the table is created with its structure and its fields are filled with the query made.