" insert into select " query in korma

205 Views Asked by At
INSERT INTO Customers (CustomerName, Country)
SELECT SupplierName, Country FROM Suppliers; 

customer table has other columns also except those "CustomerName" and "Country"

This is my simple sql query.

Please help me to write it in KORMA SQL.

1

There are 1 best solutions below

0
ntalbs On

You can to that almost the same as the sql:

; assuming that you already define entities, customer, suppliers
(insert customers
  (values (select suppliers
                  (fields :suppliername :country))))