Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to add records to the database

2025-04-09 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

How do I add records to the database? Perhaps many people do not understand, in order to let you understand better, the editor summed up the following content, I hope you can gain something according to this article.

The sql command to add records to the database is INSERT INTO.

Syntax of the INSERT INTO statement

INSERT INTO statements can be written in two forms, namely:

The first form

Instead of specifying the name of the column in which you want to insert data, simply provide the value to be inserted:

INSERT INTO table_nameVALUES (value1,value2,value3,...)

The second form

You need to specify the column name and the value to be inserted:

INSERT INTO table_name (column1,column2,column3,...) VALUES (value1,value2,value3,...)

Example:

Insert into # tblInsert (Col1, Col2, Col3, Col4) values ('Zhang San', 30, 9850.5, 1); insert into # tblInsert (Col1, Col2, Col3, Col4) values ('Li Si', 40, 10000, 0); insert into # tblInsert (Col1, Col2, Col3, Col4) values ('Wang Wu', 50, 8753.15, 1) The above is the method shared by the editor to add records to the database. If you have similar doubts, you might as well refer to the above method to try. If you want to know more about it, please follow the industry information.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 257

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report