在SQL表中仅添加一个值 [英] Adding only one value to the table in sql
问题描述
我有一个名为student
的表,该表由(rollno, name, sem, branch
)
I have a table named student
which consists of (rollno, name, sem, branch
)
如果我只想INSERT
一个值(即只需输入名称),查询是什么?
If I want to INSERT
only one value (i.e only name has to be entered) what is the query?
推荐答案
要将值插入特定列,首先必须指定要填充的列.查询如下所示:
To insert values into specific columns, you first have to specify which columns you want to populate. The query would look like this:
INSERT INTO your_table_name (your_column_name)
VALUES (the_value);
要在多个列中插入值,请用逗号分隔列名称,并按添加列名称的顺序插入值:
To insert values into more than one column, separate the column names with a comma and insert the values in the same order you added the column names:
INSERT INTO your_table_name (your_column_name_01, your_column_name_02)
VALUES (the_value_01, the_value_02);
如果不确定,请访问W3Schools.com.他们通常会举例说明.
If you are unsure, have a look at W3Schools.com. They usually have explanations with examples.
这篇关于在SQL表中仅添加一个值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!