Get the App
SLTechnology News&Howtos  ›  Database  › 

MySQL data operation

Shulou Source: shulou.com Published: 2022-06-01 07:04:42 09月30日 Update

-- insert information

-- method 1:insert...values

-- single statement

Insert into table name values (data)

Eg:

Insert into class values (21403001 'Zhang San', 'male', 20 'Chongqing')

-- multiple statements

Insert into table name values (data), (data), (data)

Eg:

Insert into class values

(null,' floret 1 'female', 31 'Hebei 313' female', Hebei 313 female null)

(null,' floret 1 'female', 31 'Hebei 313' female', Hebei 313 female null)

(null,' floret 1 'female', 31 'Hebei 313' female', Hebei 313 female null)

-- method 2:insert...set

Insert into table name set field 1 = value 1, field 2 = value 2. Field n = value n

Eg:

Insert into class set id=null,name=' floret 1 minute recently sexualized 'female', age=32,address=' Hebei 3 minute recorder daytime nulle journal remark null

-- method 3:insert...select

Table inserted by insert into select * from original table

Eg:

Insert into class1 select * from class

-- query data

Method 1: query specific rows and columns

Select field from table name where conditional expression

Eg:

Select id, name from class where id

Tags: Fields data methods remarks florets Hebei conditions expressions sorting queries transactions letters numbers results statements Zhang San Wang Wu security information multiple Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Shulou Information vpn MySQL Apple Shulou Tech Info