I want to add weight value to row 2. How do I do that? I tried to do the following but it gives me an error:
INSERT INTO name(member_id, weight) VALUES(2,55.6);
What is the mistake that I'm having?
If you're updating a specific row you need to use the UPDATE command
UPDATE talbename
SET weight =55.6
WHERE member_id = 2
You can use the UPDATE clause and use a WHERE condition to target a particular row -
UPDATE fromis_9
SET weight = 2
WHERE member_id = 2;
CREATE TABLE statement (from your screenshot) shows that you didn't add the weight column at the time of creating the table. Did you add in the correct data type when you added it in later?Hi I think you should use INSERT INTO table where condition(member.id=2) please refer to https://www.w3schools.com/sql/sql_insert_into_select.asp Its better to learn how to read documentation than wait for complete answer ;)
weightcolumn value of the second row? If so, you need to update the row bymember_idcolumn. If you're trying to add a column to an existing table, you'll need anALTER TABLEstatement, something like:ALTER TABLE table ADD [COLUMN] column_name column_definition [FIRST|AFTER existing_column];. You can find more info here: