Questions tagged [replace]
The replace tag has no summary.
85 questions
0 votes
1 answer
59 views
Mariadb replace without touching same rows
I have a relatively small table (~250k rows) heavily using fulltext indexes. This table is updated every day basically replacing the rows with new information. However, the new rows are mostly the ...
0 votes
1 answer
192 views
Snowflake SQL replace function - leverage a dictionary?
Looks like translate works for multi translations of single characters (abc -> xyz), but Replace in snowflake will only do 1 replacement. I have a list of JSON objects in a Snowflake SQL database ...
0 votes
1 answer
52 views
How can the data flow show the number of values changed by a Derived Column that replaces a given column if a condition is met?
I take a Derived Column Transformation to replace a value as soon as a condition on two other columns is met. How can I see in the data flow how often a value changes by this replacement? Is there a ...
1 vote
2 answers
86 views
Converting a number to a varchar, doing an operation, converting it back to a number in MySQL
I am trying to solve The Blunder challenge under MySQL database and I am running into an error in what I thought to be a correct answer: SELECT CEIL(AVG(Salary) - AVG(CAST(REPLACE(CAST(Salary AS ...
0 votes
1 answer
73 views
MySQL - how to update only some characters in a column value - longtext (DC2Type:array)
MySQL: 8.0.35 - Source distribution I have longtext (DC2Type:array) column and incorrect some characters values in a column string, so i want to replace this data format: a:2:{s:7:"content";...
1 vote
1 answer
678 views
Regex help in Snowflake
I am trying to write a regex that can replace '[', ']' and '].' with '_' and in cases where ']' is the last character it should be replaced with '' but I am struggling to come up with a regex for it ...
0 votes
1 answer
228 views
Query for converting a column of numbers matching a regex in MySQL
I have a column which contains string values of the format e.g AB12345678 - two letters followed by 8 numeric digits. I need to write a MySQL query to insert a 5 before each set of 4 digits thus ...
0 votes
2 answers
72 views
in the school database course they teaches us with oracle database & i have a macbook what is the best replacement database to use?
in the school database course they teaches us with oracle database & i have a macbook what is the best replacement database to use?
3 votes
1 answer
318 views
Does the Sql Server REPLACE function increase the estimated row size?
Analyzing a simple query, I noticed that the REPLACE function increases the estimated row size. Look at the following query, executed on AdventureWorks: select p.BusinessEntityID, REPLACE(p.FirstName, ...
1 vote
1 answer
342 views
SQL Server procedure, to find and replace data inside big table
I need to write a store procedure to update link reference in my DB. Link can be contained in few nvarchar field that contains JSONs (that could contains some urls). To do so i update the tables in ...
0 votes
0 answers
97 views
Search from text file contain string and replace row
My database table named VmIpAddress has the following 12 columns id, hosting_id, server_id, vm_id, ip, mac_address, subnet_mask, gateway, cidr, trunks, tag, net A row might contain for example "...
0 votes
0 answers
490 views
Replacing Part of a string within a group Concat
I have part of a string that I would like to remove when selecting. The Problem is that there are a few pieces within the string that changes. This is what I have so far. Select GROUP_CONCAT(...
1 vote
1 answer
396 views
Is there a template-like expression in Sql Server?
I place the alias values in sql into a string sentence and constantly generate a new string with replace. But I have to do a lot of "replace" nested this way. The {{name}} in the string ...
0 votes
0 answers
134 views
Change query to replace string by values in table of replacement
To store emails list I have two quite simple tables, domain and mailbox, so [email protected] is stored as: domain id domain_name 1 domain.com mailbox id local_part domain_id 1 user 1 (local_part is ...
7 votes
2 answers
2k views
Advantage of "LOAD DATA ... REPLACE INTO TABLE" over "UPDATE table_name SET"
I inherited a system in which all updates (even to a single row/record) to MySQL tables are not done using UPDATE table_name SET. Rather, they are done by: Exporting the existing table to a CSV (text)...