วันเสาร์ที่ 13 ธันวาคม พ.ศ. 2557

3. SQL INSERT

เป็นคำสั่งที่ใช้สำหรับเพิ่มข้อมูลลงในตาราง (Table) โดยสามารถเพิ่มได้ทั้งแถวหรือว่าเพิ่มในส่วนของแต่ละฟิวด์
Database : MySQL,Microsoft Access,SQL Server,Oracle
Syntax
INSERT INTO [Table-Name] (Column1,Column2,Column3,...) VALUES ('Value1','Value2','Value3',...)
Table : country
CountryCode
CountryName
TH
Thailand
EN
English
US
United states
Sample1 การเพิ่มข้อมูลลงใน Table
INSERT INTO country VALUES ('CH','Chaina')
หรือ
INSERT INTO country (CountryCode,CountryName) VALUES ('CH','Chaina')
Output

CountryCode
CountryName
TH
Thailand
EN
English
US
United states
CH
Chaina



ไม่มีความคิดเห็น:

แสดงความคิดเห็น