N
N
NeoZeed2014-05-13 13:42:36
SQL
NeoZeed, 2014-05-13 13:42:36

How to create a SQL table whose columns are the result of a SELECT query?

Something like CREATE TABLE NewT(Col1, SELECT DISTINCT Prod From Old_table).
Just to make it work, preferably in sqlite.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexey Skahin, 2014-05-13
@pihel

www.sqlite.org/lang_createtable.html

CREATE TABLE NewT AS SELECT DISTINCT Prod From Old_table;

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question