Home > Software engineering >  ERROR: INSERT has more target columns than expressions, this is the error which I'm getting in
ERROR: INSERT has more target columns than expressions, this is the error which I'm getting in

Time:12-31

INSERT INTO customer_data
  (cus_id, cust_name, age, city, salary)
VALUES
  (1, 'Sam', 'Delhi',9000),
  (2, 'ROhit', 'Banglore', 5000),
  (3, 'Rahul', 'Mumbai', 12000),
  (4, 'Sunny', 'Odisha',15000);

This is my Code

CodePudding user response:

Your SQL query should contain same number of columns as same number of values you column count in this

INSERT INTO customer_data (**cus_id**, **cust_name**, **age**, **city**, **salary**) 

part of query is 5 whereas value count is 4 in this part

VALUES (**1**, **'Sam'**, **'Delhi'**,**9000**) ...

CodePudding user response:

the values part is missing the age value

  • Related