Solved

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

Posted on 2016-11-08
1
67 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Cursors in Oracle: A cursor is used to process individual rows returned by database system for a query. In oracle every SQL statement executed by the oracle server has a private area. This area contains information about the SQL statement and the…
Using SQL Scripts we can save all the SQL queries as files that we use very frequently on our database later point of time. This is one of the feature present under SQL Workshop in Oracle Application Express.
This video shows how to Export data from an Oracle database using the Original Export Utility.  The corresponding Import utility, which works the same way is referenced, but not demonstrated.
This video shows how to configure and send email from and Oracle database using both UTL_SMTP and UTL_MAIL, as well as comparing UTL_SMTP to a manual SMTP conversation with a mail server.

751 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