[Webinar] Streamline your web hosting managementRegister Today

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 88
  • Last Modified:

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

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
1 Solution
slightwv (䄆 Netminder) Commented:
update table set url='http://' || hostname || '.xyz.com'

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now