like query and then update or replace

like query and then update or replace

In postgres i use like query to find the a specific word in a column for example in a column i have text "Small state in wmost Brazil bordered by sw Amazonas, Peru, and Bolivia."

with like query i can find text that contains text "wmost" after finding that i want to replace or update "wmost" to "westernmost" in that text.

is there a way to do that?

Please need urgent help in this matter.

Best YJ

View Answers

April 1, 2011 at 4:21 PM

We have created a table message(id,data);

Use the following query:

update message set data = replace (data, 'wmost','westernmost');

April 4, 2011 at 5:04 PM

thanks a lot i could do it with this, but the only problem is if i want to change "nmost" to "northernmost" this query also changes "southernmost" to "southernothernmost". if you notice then "nmost" is common in other strings also. is there a way to avoid this problem. Can you send similar query using regexp_replace expression so that it only identifies "nmost" and not anyone of these: southernmost, easternmost, northernmost, westernmost.

Really appreciate your help.

Thanks YJ









Related Tutorials/Questions & Answers:
like query and then update or replace
like query and then update or replace   In postgres i use like query... to replace or update "wmost" to "westernmost" in that text. is there a way to do... "Small state in wmost Brazil bordered by sw Amazonas, Peru, and Bolivia." with like
regexp_replace in update and replace query in postgres
regexp_replace in update and replace query in postgres  update message set data = replace (data, 'wmost','westernmost'); April 4, 2011 at 5:04 PM.... is there a way to avoid this problem. Can you send similar query using regexp_replace
Advertisements
update query
update query  using oops concept in php.. How to update the data from databse ? with program example
Update SQL Query Example
Update SQL Query Example  Hi, I am beginner in SQL (MySQL) and trying to learn Update SQL Query with Example code. Can anyone explain me the SQL Update query with an example code? Thanks (adsbygoogle
Hibernate Like Query
This section illustrate hibernate like query with example
Hibernate update Query
Hibernate update Query In this tutorial you will learn about an update query in Hibernate This tutorial is based on how to write HQl update query in hibernate. In hibernate update query updates the data of the database table when
Replace
Replace   Hi, I have two text files in two diff locatons.The text file like below using java program 1)a.txt (adsbygoogle... || []).push({}); Now i want output is like below format a.txt A abc
Hibernate HQL query by using like operator.
Hibernate HQL query by using like operator.  How use like operator in HQL?   HQL stands for Hibernate Query Language, provided by Hibernate... from Employee emp WHERE emp.name like 'R%'"; Query query
ereg_replace() and eregi_replace().
ereg_replace() and eregi_replace().  What is the difference between eregreplace() and eregireplace()?   Hi friends, ereg_replace() is case sensitive like "Bharat"cannot be treated as "bharat"and eregi_replace
how do i use sql like query in my jsp page
how do i use sql like query in my jsp page  how do i use sql like query in my jsp page   Hi Friend, Try the following code:ADS...("select * from data where name like 'a%'"); while(rs.next()){ out.println
Elasticsearch update by query add field
Elasticsearch update by query method to add field into existing documents of Elasticsearch In this tutorial we are going to add fields into existing... following: POST /store/_update_by_query?pretty { "query" : { "match_all
Elasticsearch update by query add field
Elasticsearch update by query method to add field into existing documents of Elasticsearch In this tutorial we are going to add fields into existing... following: POST /store/_update_by_query?pretty { "query" : { "match_all
Elasticsearch update by query add field
Elasticsearch update by query method to add field into existing documents of Elasticsearch In this tutorial we are going to add fields into existing... following: POST /store/_update_by_query?pretty { "query" : { "match_all
Elasticsearch update by query add field
Elasticsearch update by query method to add field into existing documents of Elasticsearch In this tutorial we are going to add fields into existing... following: POST /store/_update_by_query?pretty { "query" : { "match_all
Elasticsearch update by query add field
Elasticsearch update by query method to add field into existing documents of Elasticsearch In this tutorial we are going to add fields into existing... following: POST /store/_update_by_query?pretty { "query" : { "match_all
Hibernate Update Query
Hibernate Update Query       In this tutorial we will show how to update a row with new information... write a java class to update a row to the database. Create a java class: Here
Replace TEXT
Replace TEXT   I have two text files in two diff locatons.The text file like below using java program 1)a.txt 1 abc bangalore 2 def... || []).push({}); 2)b.txt A B C Now i want output is like below format
MySQL Replace
Query  UPDATE `mca` SET `subject` = REPLACE(`subject`,"... MySQL Replace       MySQL Replace function finds and replaces the occurrences of specified string
update
update  how can i update multiple records in database using jsp ,servlet and jdbc based on selection of checkbox in jsp
HQL Update Statement to update database table
HQL Update Statement to update database table HQL's update query statement is used to update the values of database rows. Though HQL is similar to SQL... objects and their properties. Hibernate query language (HQL) also supports WHERE
update
update  Predict and justify the output of the following code snippet written by the developer to update the Status table: String str = "UPDATE m...://localhost:3306/roseindia", "root", "root"); String str = "UPDATE Status SET
Mysql Like Operator
Mysql Like Operator       Mysql Like is used to retrieve the records on the basis of pattern matching in select query. The like comparison Operator in SQL allows you
Mysql Like Operator
Mysql Like Operator       Mysql Like is used to retrieve the records on the basis of pattern matching in select query. The like comparison Operator in SQL allows you to match any
Mysql like syntax
of pattern matching in select query. The like comparison Operator in SQL allows you... [columnname] like ['columnvalue'];  ADS_TO_REPLACE_2   Query to Create... Mysql like syntax     
Mysql like syntax
Mysql like syntax       Mysql Like is used to retrieve the records on the basis of pattern matching in select query. The like comparison Operator in SQL allows you to match any
PHP SQL LIKE Operator
; This example illustrates how to use the like operator in sql query.... $result = mysql_query("select * from emp where name like 's%'"); In the query... = mysql_query("select * from emp where name like '%h'"); In the query below
Mysql Trigger after Update
an update query on table. Understand with ExampleADS_TO_REPLACE_1 The Tutorial...; delimiter ; Query to update employee table:- mysql> update employee set start_date='20061231'; Table that has been modified after update query executes
What is the difference between ereg_replace() and eregi_replace()?
What is the difference between ereg_replace() and eregi_replace()?  What is the difference between eregreplace() and eregireplace
replace character in php
replace character in php  PHP script that replace character
find and replace in java
find and replace in java  Need 'find and replace' function in Java to find special keyword in XMl such as @,#,!,%..and replace with their corresponding entities
PHP SQL LIKE Operator
in sql query. The LIKE operator is used in a WHERE clause to search.... $result = mysql_query("select * from emp where name like 's... = mysql_query("select * from emp where name like '%h'"); In this query
MySql find and replace string
MySql find and replace string  How to find and replace string or special characters in MySql & PHP?   Find and Replace String PHP $result = preg_replace('/\band\b/i', 'foo', $subject
ModuleNotFoundError: No module named 'replace'
ModuleNotFoundError: No module named 'replace'  Hi, My Python... 'replace' How to remove the ModuleNotFoundError: No module named 'replace... to install padas library. You can install replace python with following command
python replace newline with space
python replace newline with space  Hi, I want to replace newline character \n With space in python. How to replace newline with space in python? Thanks   Hi, Its easy in python. You can use the replace method
python replace newline with space
python replace newline with space  Hi, I want to replace newline character \n With space in python. How to replace newline with space in python? Thanks   Hi, Its easy in python. You can use the replace method
Difference between translate and replace
Difference between translate and replace   hiii, What is the difference between translate and replace?   hello,ADS_TO_REPLACE_1 Replace replace every instence of character with character sting by the given charator
JDBC Execute Update Example
JDBC Execute Update Example       JDBC Execute Update query is used to modify or return you an integer value specify... a simple example from JDBC Execute update Example. In this Tutorial we want
Replace String in PHP - PHP
Replace String in PHP  What is the fastest way of replacing string in PHP Code?  Hi Friend, Please visit the following link: http://www.roseindia.net/tutorial/php/phpbasics/PHP-Array-Replace.html Thanks
String doubt replace function
String doubt replace function  What is the output and why of below : String s1 = "Hello"; if(s1.replace('H','H')== "Hello") System.out.println("yes"); else System.out.println("No"); if(s1.replace("H", "H")== "Hello
java replace dot with comma
java replace dot with comma  Hi, How to replace dot with command in Java program? thanks   Hi, Here is simple example for replacing the dot(.) with comma: package test.app; public class JavaStringExample
java replace dot with comma
java replace dot with comma  Hi, How to replace dot with command in Java program? thanks   Hi, Here is simple example for replacing the dot(.) with comma: package test.app; public class JavaStringExample
update profile
update profile  coding for update profile
how to update
how to update   conditional update
Replace JSF Standard Error Message
Replace JSF Standard Error Message  How can we replace the JSF Standard Error Message
replace special characters in html
replace special characters in html  How can i replace the special characters in HTML?   Special Character in HTML HTML has a long list of special characters symbol that can be used anywhere throughout the HTML Code
Google Ranking Update for Spammy Queries
a decline in their ranking and now with this update against spammy query Google... ranking update today for some spammy queries". This update was worldwide and many... in their ranking and disappeared from search results. This update targets spam queries
LIKE Operator
ColumnName LIKE pattern SQL Like Operator Query Now we want to select... LIKE Operator       The LIKE operator is used for searching  a specified pattern
Will AutoML replace data scientists?
Will AutoML replace data scientists?  Hi, I am beginner in Data...: Will AutoML replace data scientists? Try to provide me good examples or tutorials links so that I can learn the topic "Will AutoML replace data scientists
What Jobs Will AI not replace?
What Jobs Will AI not replace?  Hi, I am beginner in Data Science... Jobs Will AI not replace? Try to provide me good examples or tutorials links so that I can learn the topic "What Jobs Will AI not replace?". Also tell
update image
update image  sir, I want to do update image into database

Ads