Solved

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

Posted on 2016-11-08
1
58 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 77

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.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Subquery in Oracle: Sub queries are one of advance queries in oracle. Types of advance queries: •      Sub Queries •      Hierarchical Queries •      Set Operators Sub queries are know as the query called from another query or another subquery. It can …
Note: this article covers simple compression. Oracle introduced in version 11g release 2 a new feature called Advanced Compression which is not covered here. General principle of Oracle compression Oracle compression is a way of reducing the d…
Via a live example, show how to restore a database from backup after a simulated disk failure using RMAN.
This video explains what a user managed backup is and shows how to take one, providing a couple of simple example scripts.

830 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