Skip to content
Advertisement

Tag: alter

SQL append data to table using dense_rank()

I’ve been trying to piece together bits of code that I’ve googled but haven’t had any luck. I’m trying to add a new column to an existing table. I can view the column using the below code from a select query: I basically want to append the results from this select query to my original table. I’ve tried using a

Adding a new column with data

Below is my table: Now I want to add a new column called ‘Gender’ with values M,M,M,F in 4 rows respectively. I first added a new column using: Now I understand I can add data one by one by using: But how do I add all 4 data at once? Answer You don’t, unless there is some other piece of

Advertisement