-- 将临时表中的数据转储到正式表
insert into qqnt.group_msg_table (id, msg_random, msg_seq, chat_type, msg_type, sub_msg_type, send_type, sender_uid,
                                  q40026, peer_uid, peer_uin, q40040, send_status, msg_time, q40052, send_member_name,
                                  send_nick_name, msg_content, msg_quote, q40105, q40005, midnight_timestamp, elem_id,
                                  at_status, msg_status, disband_flag, reply_to, q40851, q40601, q40801, q40605,
                                  group_no, qq_no, emoji, emoji_num, emoji_num_2)
select "40001",
       "40002",
       "40003",
       "40010",
       "40011",
       "40012",
       "40013",
       "40020",
       "40026",
       "40021",
       "40027",
       "40040",
       "40041",
       to_timestamp("40050"),
       "40052",
       "40090",
       "40093",
       "40800",
       "40900",
       "40105",
       "40005",
       to_timestamp("40058"),
       "40006",
       "40100",
       "40600",
       "40060",
       "40850",
       "40851",
       "40601",
       "40801",
       "40605",
       "40030",
       "40033",
       "40062",
       "40083",
       "40084"
from qqnt.group_msg_tmp;
-- 删除临时表数据
delete
from qqnt.group_msg_tmp
where true;

-- 将临时表中的数据转储到正式表
insert into qqnt.c2c_msg_table_1007305659 (id, msg_random, q40003, chat_type, msg_type, sub_msg_type, send_type, q40020,
                                           q40026, q40021, q40027, q40040, q40041, msg_time, q40052, q40090, q40093,
                                           q40800, q40900, q40105, q40005, midnight_timestamp, q40006, q40100, q40600,
                                           q40060, q40850, q40851, q40601, q40801, q40605, peer_qq_no, sender_qq_no,
                                           q40062, q40083, q40084)
select "40001",
       "40002",
       "40003",
       "40010",
       "40011",
       "40012",
       "40013",
       "40020",
       "40026",
       "40021",
       "40027",
       "40040",
       "40041",
       to_timestamp("40050"),
       "40052",
       "40090",
       "40093",
       "40800",
       "40900",
       "40105",
       "40005",
       to_timestamp("40058"),
       "40006",
       "40100",
       "40600",
       "40060",
       "40850",
       "40851",
       "40601",
       "40801",
       "40605",
       "40030",
       "40033",
       "40062",
       "40083",
       "40084"
from qqnt.c2c_msg_tmp;
-- 删除临时表数据
delete
from qqnt.c2c_msg_tmp
where true;
