![](https://img-blog.csdnimg.cn/20201014180756928.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
sql
xiyue613
世界上最遥远的距离是在想到和做到之间
展开
-
改变表结构
alter table fxown_house add column create_time datetime not null comment '创建时间'; alter table house_ledger drop disaster_type, DROP disaster_date; alter table house_ledger modify column disaster_event bigint NOT NULL COMMENT '灾害事件ID'; UPDATE support_netraf.原创 2021-05-06 16:48:27 · 67 阅读 · 0 评论 -
text改为longtext
CREATE TABLE `edata` ( `DATA_ID` bigint NOT NULL AUTO_INCREMENT COMMENT '数据ID', `EVENT_ID` bigint DEFAULT NULL COMMENT '事件ID', `SURVEY_DIRECTORY` varchar(1000) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '调查报告目录', `SURVEY_CONTENT` longtext CHAR...原创 2021-04-16 09:03:48 · 603 阅读 · 0 评论 -
去重
DELETE FROM house_damage_ledger WHERE (area_code, household_head_id) IN ( SELECT t.area_code, t.household_head_id FROM ( SELECT area_code, household_head_id ...原创 2021-04-26 10:59:09 · 66 阅读 · 0 评论 -
重复列表
先加条件,再从搜索结果group by SELECT * FROM house_damage_ledger WHERE household_head_id in(SELECT household_head_id FROM ( SELECT household_head_id, area_code, to_char(disaster_date,'yyyy') as ye FROM house_damage_ledger WHERE ye >= '2014' and ye <= '...原创 2021-04-26 13:17:12 · 94 阅读 · 0 评论 -
查询多表
select LEGAL_ID as id, name as title,1 as type from rl WHERE name like '%法%' union all select MSDS_ID as id,name as title,2 as type from rs WHERE name like '%法%' union all select STANDARD_ID as id,name as title,3 as type from rd WHERE name like '%法%' ...原创 2021-04-29 14:24:20 · 52 阅读 · 0 评论 -
字段关键字
人大金仓 `NAME`, `STATUS` insert into sr ("NAME", "STATUS" mysql `NAME`, `TYPE` insert into rd (STANDARD_NUMBER, `NAME`, `TYPE`,原创 2021-04-29 14:33:23 · 138 阅读 · 0 评论