473,499 Members | 1,926 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Using REPLACE to replace multiple values in query result

23 New Member
Hi,

I'm running a query that displays a list of values. for example the result will be :

a
b
c
d


I would like to replace "a","b" and "c" with strings of my own. How is that possible ? Using the "Replace" function allowed me to change only one string.

Thanks.
Oct 21 '07 #1
2 36342
iburyak
1,017 Recognized Expert Top Contributor
You can use case or nested replace.

Expand|Select|Wrap|Line Numbers
  1. select case when col in (a,b,c) then 'string here' else col end

or
Expand|Select|Wrap|Line Numbers
  1. select replace(replace(col, 'a', 'string here'), 'b', 'string here') ......

Good Luck.
Oct 21 '07 #2
Samrat Gavale
1 New Member
@ iburyak,
very helpful post.
Thank you so much!
Apr 2 '11 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

0
6678
by: Nashat Wanly | last post by:
HOW TO: Call a Parameterized Stored Procedure by Using ADO.NET and Visual C# .NET View products that this article applies to. This article was previously published under Q310070 For a Microsoft...
4
5137
by: Stuart E. Wugalter | last post by:
Here is a sample of what I want to do: Table 1 ID FIELD1 FIELD2 1 A T 2 G C 3 T C Table2 ID FIELD1 FIELD2
6
17133
by: ransoma22 | last post by:
I developing an application that receive SMS from a connected GSM handphone, e.g Siemens M55, Nokia 6230,etc through the data cable. The application(VB.NET) will receive the SMS automatically,...
0
1937
by: peridian | last post by:
Hi, I wanted a web page where I could post code to, and have it appear in coloured formatting based on the context of the code. Most of the techniques I have seen for this involve complex use...
11
16279
by: funky | last post by:
hello, I've got a big problem ad i'm not able to resolve it. We have a server running oracle 10g version 10.1.0. We usually use access as front end and connect database tables for data extraction....
11
15231
by: TechnoAtif | last post by:
INSERT AND UPDATE MULTIPLE CHECKBOX DATA USING PHPMYSQL OR JAVASCRIPT Hi All I want to check the multiple checkboxes update them after revisiting that page. I am taking the name as...
0
3990
by: David | last post by:
- Are there any peculiarities with using curs.executemany(...) vs. multiple How many times are you calling execute vs a single executemany? The python call overhead will add up for thousands of...
1
4579
by: javediq143 | last post by:
Hi All, This is my first post in this forum. I'm developing a CMS for my latest website. This CMS is also in PhP & MySQL. I'm done with the ADD section where the Admin can INSERT new records in...
14
2300
by: asivakrupa | last post by:
Hi, I am creating a tool with PHP as front end and SQL Server as back end. I have some values to be inserted into the DB which contains the character ( ' ) i.e single quote. I had errors when...
0
7134
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7012
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7180
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7225
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
7392
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5479
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
4920
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3101
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
307
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.