mysql新增字段
ALTER TABLE work_device_cur ADD COLUMN che_user_id bigint(20) NOT NULL COMMENT '确认人员id' AFTER cur_sele_time;
update 和 CONCAT 使用
UPDATE `xxx_table` a
SET a.ext_info = CONCAT(
'
{
"formDesc": {
"mask": {
"label": "掩码",
"type": "input",
"layout": 8,
"default": "',
`a.xx`,
'"
},
"gateway": {
"label": "网关",
"type": "input",
"layout": 8,
"default": "',
`a.yy`,
'"
},
"vlan": {
"label": "VLAN",
"type": "input",
"layout": 8,
"default": "',
`a.cc`,
'"
}
}
}'
);
insert 和 select使用
INSERT INTO test (aa, bb, cc) SELECT
(
SELECT
FLOOR(
+ RAND() * 10000000000000000000
)
),
a.bb,
a.cc
FROM
`xxx_table` a