Jump to content
thirty bees forum

Recommended Posts

Posted

Hi!
Someone can help with an sql query please.

I need to copy data from one column in the table to a second column in the same table. But only if the cell in the second column is empty. If the sell contains info it should be left

Hope some sql guru understand the problem

Posted (edited)
28 minutes ago, Havouza said:

I need to copy data from one column in the table to a second column in the same table. But only if the cell in the second column is empty. If the sell contains info it should be left

Hello. Not a big SQList, but, try this (after backing up the database!)

UPDATE yourTableName
                SET secondcolumn = onecolumn
                    FROM yourdatabase
                    WHERE secondcolumn IS NULL

 

 

Edited by Wartin

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...