How to select data from a table and insert into another table?

后端 未结 3 568
我寻月下人不归
我寻月下人不归 2021-01-31 20:20

I want to select specific fields of a table in cassandra and insert them into another table. I do this in sql server like this:

INSERT INTO Users(name,family)
         


        
3条回答
  •  谎友^
    谎友^ (楼主)
    2021-01-31 20:27

    COPY keyspace.columnfamily1 (column1, column2,...) TO 'temp.csv';
    COPY keyspace.columnfamily2 (column1, column2,...) FROM 'temp.csv';
    

    here give your keyspace(schema-name) and instead of columnfamilyname1 use the table to which you want to copy and in columnfamily2 give the tablename in which you want to copy..

    And yes this is solution for CQL,however I have never tried in with CLI.

提交回复
热议问题