sql - SQL Batch editing with Regexp (i think)
问题描述
So before starting, i just want to say that i know basically nothing about sql and didn't choose this format, i just dont have a different choice for the program using this file.
I have a sql database and i need to make some changes to it. My Problem is the following:
One of the tables, which has over 2000 rows of entries, has a column with this format: string0 / string1 / string2 / string3 ...
. The program seperates the strings at the "/" and uses the seperated strings.
What i need to do is clone string2
and insert the clone as string3
. This should create something like this: string0 / string1 / string2 / string2clone / string3 ...
As i have no experience with sql i dont even know if this is possible but my best guess would be to batch edit all values with a regexp. I'm currently only using DB Browser for SQL.
解决方案
Do you have upload access? 2000 rows is small. I would copy paste it in to Excel, add in the your duplicate string and re-upload.
In SQL you could break apart the column, create a duplicate column of string 2 and concatenate it back together...not the approach I would take but it would definitely depend on your read/write access.
推荐阅读
- sql-server - Error in a SQL Job, Exception has been thrown by the target of an invocation
- python - 语音识别返回意外错误
- angular - 如何在角度/打字稿中正确覆盖子类中基类的属性?ngx-quill 和材料
- twilio-video - 如何使用纯 javascript 将 Twilio Video 集成到我的 asp.net mvc 应用程序中?
- reactjs - React - 简单地显示状态对象值
- checkout - 如何在结账时禁用(忽略)库存 - Bigcommerce
- db2 - 在 DB2 中使用 Node-RED 使用 node-red-nodes-cf-sqldb-dashdb 创建一个表
- javascript - 如何将 Vuetify 快餐栏组件垂直对齐到中心?
- xslt - Remove whitespace left by element removal using XSLT
- python - 如何用 BeautifulSoup 解析字典结构数据?