想知道是否有可能在一个插入声明中完成以下内容?
drop table analytics.bw_covariance_matrix;
create table analytics.bw_covariance_matrix (
row int,
x1 float,
x2 float,
x3 float
);
insert into analytics.bw_covariance_matrix VALUES
(1, 4.01926965, -0.4686067, -0.07592112),
insert into analytics.bw_covariance_matrix VALUES
(2, -0.46860675, 4.1799267, -0.82461139);
insert into analytics.bw_covariance_matrix VALUES
(3, -0.07592112, -0.8246114, 4.37186211);
Run Code Online (Sandbox Code Playgroud)
您可以UNION使用SELECT来生成单个INSERT语句:
insert into analytics.bw_covariance_matrix
SELECT 1, 4.01926965, -0.4686067, -0.07592112
UNION
SELECT 2, -0.46860675, 4.1799267, -0.82461139
UNION
SELECT 3, -0.07592112, -0.8246114, 4.37186211
Run Code Online (Sandbox Code Playgroud)
我不相信Vertica有像MySQL和其他RDBMS这样的多记录插入语句,所以这是最好的选择.
| 归档时间: |
|
| 查看次数: |
7159 次 |
| 最近记录: |