Home > front end >  Insert data into table except one column SQL
Insert data into table except one column SQL

Time:12-07

I just want to know if it is possible to insert data into a table that has columns for example ID, FIRST_NAME, AGE, SEX, SALARY but I want to insert into all columns except the column id.

Normally as I know I need to set this code

INSERT_INTO TABLE_NAME (FIRST_NAME, AGE, SEX, SALARY) 
VALUES (....);

but it will take a long time if there is a lot of columns...

Is there any code that will grant me time?

CodePudding user response:

you can pass null value for the columns you don't want to set.

Entry will be inserted with the default value if provided in the schema, or null is field is nullable

  •  Tags:  
  • sql
  • Related