Solved

I want to write a query to populate column values based on another column

Posted on 2016-11-08
1
32 Views
Last Modified: 2016-11-08
Example :

If table has two columns

S.No     Hostname        URL

1           abc                    
2           efg
3           hij
4           klmn

the result after query execution should be:

S.No     Hostname        URL

1           abc                    http://abc.xyz.com
2           efg                     http://efg.xyz.com
3           hij                      http://hij.xyz.com
4           klmn                 http://klmn.xyz.com


Please help me with an oracle statement.

something like

update table set url='http://<correspondinghostname>.xyz.com'

Any help would be highly appreciated.

Thanks for you help!

Best Regards
Devsupport
0
Comment
Question by:DevSupport
1 Comment
 
LVL 76

Accepted Solution

by:
slightwv (䄆 Netminder) earned 500 total points
ID: 41879185
update table set url='http://' || hostname || '.xyz.com'
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Join & Write a Comment

Suggested Solutions

Checking the Alert Log in AWS RDS Oracle can be a pain through their user interface.  I made a script to download the Alert Log, look for errors, and email me the trace files.  In this article I'll describe what I did and share my script.
From implementing a password expiration date, to datatype conversions and file export options, these are some useful settings I've found in Jasper Server.
This video shows how to copy a database user from one database to another user DBMS_METADATA.  It also shows how to copy a user's permissions and discusses password hash differences between Oracle 10g and 11g.
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now