Jump to content
thirty bees forum

Sql query


Havouza

Recommended Posts

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

Link to comment
Share on other sites

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
Link to comment
Share on other sites

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...