南大通用GBase 8a集群导出数据带表头字段名

GBase 8a集群导出数据带表头字段名,通过with head参数指定。当数据第一行实际是表头时,可以自动忽略。

gbase> select * from t_grouped into outfile '/home/gbase/grouped.txt'  FIELDS TERMINATED BY '' ENCLOSED BY '' ESCAPED BY '' writemode by overwrites with head;
Query OK, 2 rows affected (Elapsed: 00:00:00.04)

gbase> select * from t_grouped;
+------+------+------+------+------+------+------+------+------+------+
| id1  | id2  | id3  | id4  | id5  | id6  | id7  | id8  | id9  | id10 |
+------+------+------+------+------+------+------+------+------+------+
|    1 |    2 |    3 |    4 |    5 |    6 |    7 |    8 |    9 |   10 |
|   11 |   12 |   13 |   14 |   15 |   16 |   17 |   18 |   19 |   20 |
+------+------+------+------+------+------+------+------+------+------+
2 rows in set (Elapsed: 00:00:00.01)