Skip to main content

SQL tutorial: Update multiple Column into one column using the same table

The point of this tutorial is to show you how to update multiple column into one column using the same table.

Step 1
First you have to make sure that the select statement is correct, try to use the below example to see if your statement display the correct value.

Example:
select columnA||columnB from TABLE A;

if you wish to include some kind of delimiter
select columnA||', '||columnB from TABLE A;


Step 2
Update TABLE A set column A = (select columnA||', '||columnB from TABLE A where A.index = B.index);

Step 3
Once you are sure about your value, please commit the action.
commit();

That is it! This conclude the tutorial on how to update multiple column into one column using the same table!

Comments

Popular posts from this blog

My thought on USD/Gold fundamental analysis 09 April 2015

USD - ↔  Gold -↓ Current USA data is pointing to a robust recovery, with a stable employment rate and a stable growth. Yes the data from march was a major disappointment(weather?) but overall data so far is looking good, not great, but good. So what does good data means? USA is still out growing most developing countries and Euro even with just a "Good". Together with Oil price swinging ever lower, and with Iran joining in with the global oil market which will push oil price even lower. the inflation rate will set to be ever lower. Good Usa growth plus low inflation combine with non stop influx of credit, point to a market that investors dare to seek higher return with higher risk investment which is not good for Gold. So going long to mid term(end of 2015?), the Gold price would be projected to go down. I am aiming for at least a USD1100 per ounce range. Please be advise that forex is a high risk investment, there will be a very high chance of lost o...

Kindle Paperwhite

First-Ever Paperwhite Display Brilliant Resolution Our Paperwhite display offers 62% more pixels, and renders exceptionally sharp, clear text and images. Stunning Contrast Kindle Paperwhite's screen has 25% higher contrast. Crisp, dark text against a brilliant white background makes for the perfect read. Innovative Built-in Light Paperwhite guides light towards the display from above instead of projecting it out at your eyes like back-lit displays, thereby reducing screen fatigue. You can adjust your screen's brightness to create a perfect reading experience in all lighting conditions, from bright sunlight to bedtime reading. Uncompromised Battery Life A single charge lasts up to eight weeks, based on a half hour of reading per day with wireless off and the light setting at 10. Our breakthrough power management technology allows you to leave the light on at all times for the best possible contrast without sacrificing battery life. Read ...

Free server for Terraria: Singapore Base

Update: Click here for the latest update IP: 175.156.159.250 port: 7777 password: server672011 email: ohguowei@gmail.com updated: hai, i give up on port forwarding. sorry guys, i will be using hamachi for terraria. this game is just too unstable for multi player hamachi ip: 5.100.228.220 hamachi network: sgterraria hamachi password: sgterraria terraria password: server672011 opening time 12pm to 12am. email me if you need help, but dont expect me to do much since this is a free server.