在SQL表中仅添加一个值 [英] Adding only one value to the table in sql

查看:70
本文介绍了在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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆