首页 > 数据库 >mysql修改json字段sql备份

mysql修改json字段sql备份

时间:2024-01-11 10:24:19浏览次数:25  
标签:mysql JSON content json sql entry extract id

update dec_main a,
            dec_main_copy20240110 b
            set a.ie_Date = b.ie_Date,
                    a.declaration_data = b.declaration_data,
                    a.custom_state = b.custom_state,
                    a.content = JSON_SET(a.content, '$.ieDate', json_extract(b.content,'$.ieDate')) , 
                    a.content = JSON_SET(a.content, '$.declarationData', json_extract(b.content,'$.declarationData')) , 
                    a.content = JSON_SET(a.content, '$.customState', json_extract(b.content,'$.customState'))  
        where a.cus_sourece ='91320600138342054Q' 
          and b.cus_sourece = '91320600138342054Q'  
          and a.entry_id = b.entry_id 
          and ifnull(a.entry_id,'-') != '-'
          and ifnull(b.entry_id,'-') != '-'  ;         

 

标签:mysql,JSON,content,json,sql,entry,extract,id
From: https://www.cnblogs.com/xueblvip/p/17957972

相关文章

  • DM7_SQL语言使用手册_第 1 章 结构化查询语言 DM_SQL 简介
    第1章结构化查询语言DM_SQL简介结构化查询语言SQL(StructuredQueryLanguage)是在1974年提出的一种关系数据库语言。由于SQL语言接近英语的语句结构,方便简洁、使用灵活、功能强大,倍受用户及计算机工业界的欢迎,被众多计算机公司和数据库厂商所采用,经各公司的不断修改......
  • mysql实现数据文件存储到指定分区
    通过rpm安装的mysql默认程序文件放在/usr/bin,数据文件放在/var/lib/mysql,需要将数据文件放在不同分区,保证数据量时将根目录撑爆一、关闭数据库[root@node1bin]#systemctlstopmysqld[root@node1bin]#systemctlstatusmysqld●mysqld.service-MySQLServerLoaded:lo......
  • MySQL InnoDB ReplicaSet安装文档
    MySQL副本集介绍MySQLInnoDBReplicaSet(也叫MySQL副本集,有些地方也翻译成MySQL复制集)是在MySQL8.0.19版本(2020-01-13Released)之后开始支持的,MySQL副本集中拥有一个primary节点,一个或多个secondary节点,它不像MySQLInnoDBCluster一样提供故障自愈和多主模式,但是它提供手......
  • SQL Server报错The datediff function resulted in an overflow
    建模提醒功能异常,获取查询语句到数据库执行报错:Msg535,Level16,State0,Line62Thedatedifffunctionresultedinanoverflow.Thenumberofdatepartsseparatingtwodate/timeinstancesistoolarge.Trytousedatediffwithalessprecisedatepart.消息535,级......
  • MySQL Ignoring the redo log due to missing MLOG_CHECKPOINT between the checkpoin
    错误信息:2023-12-12T09:32:31.383149Z0[ERROR]InnoDB:IgnoringtheredologduetomissingMLOG_CHECKPOINTbetweenthecheckpoint5777611209andtheend5777612857.2023-12-12T09:32:31.384149Z0[ERROR]InnoDB:PlugininitializationabortedwitherrorGeneri......
  • SQL统计案例
    SELECTdr_id,dr_nameas'区域名称',#早餐SUM(IF(is_muslim=1ANDmeal_type=1,order_number,0))as'早餐清真餐总数',SUM(IF(is_muslim=0ANDmeal_type=1,order_number,0))as'早餐非清真餐总数',SUM(IF(is_muslim=1ANDorder_status=3ANDmeal_type=1,order......
  • [protobuf] ProtoBufEditor 解析bin文件和json文件
    ProtoBufEditor解析bin文件和json文件ProtoBufEditor是一个用于编辑ProtocolBuffers(ProtoBuf)文件的工具。支持导入的文件类型SingleMessageDelimitedMessagesSelfDescribingMessageSelfDescribingDelimitedText(SingleMessage)Json(SingleMessage)解析bin......
  • delphi JSON序列化(五)
    关于TJSONConverters的使用unitUnit1;interfaceusesWinapi.Windows,Winapi.Messages,System.SysUtils,System.Variants,System.Classes,Vcl.Graphics,Vcl.Controls,Vcl.Forms,Vcl.Dialogs,Vcl.StdCtrls,Vcl.Buttons,Rest.JSON.Types,Rest.JsonReflect;t......
  • delphi JSON序列化(四)
    涉及的重要类REST.Json,REST.JsonReflect,REST.Json.Interceptors,REST.Json.Types单元中。一、TJson类最简单的一个类,提供了JSON->OBJECT和OBJECT->JSON几个方法,方法有TJsonOptions参数,如:   classfunctionObjectToJsonObject(AObject:TObject;AOptions:TJsonOpti......
  • 揭秘MySQL中的"黑洞":为什么你应避免默认使用NULL值?
    摘要:在MySQL中,NULL值是一种特殊的标记,表示数据缺失或未知。然而,默认使用NULL值可能会引发一系列问题。本文将深入探讨为什么不建议默认使用NULL值,并通过具体示例揭示其潜在风险。一、什么是NULL值?在MySQL中,NULL表示一个字段没有值或数据未知。不同于空字符串("")或0,NULL表示缺失或......