In SQL, How to add values after add a new column in the existing table?

前端 未结 7 1467
臣服心动
臣服心动 2021-02-14 13:34

I created a table and inserted 3 rows. Then I added a new column using alter. How can I add values to the column without using any null values?

7条回答
  •  南方客
    南方客 (楼主)
    2021-02-14 14:09

    Why don't you use UPDATE statement:

    UPDATE tablename SET column=value 
    

    WHERE is optional. For instance in T-SQL for table:

    I can update column NewTestColumn by this statement:

    UPDATE [dbo].[Table] SET [NewTestColumn] = 'Some value'
    

提交回复
热议问题