测牛学堂:2023软件测试面试分享总结之常见sql语句汇总(2)

最常用的sql语句总结

1 选择:

select * from  table1 where 范围

2插入:

 insert into table1 (field1,field2) values(value1, value2)

3更新:

update table1 set field1=value1 where 范围

4删除:

 delete from table1 where 范围

5查找:

select *from table1 where field1 like '%value1%'

6排序:

select * from table1 order by field1.field2 [desc]

7 总数:

select count as totalcount from table1

8求和:

 select sum(fieldl) as sumvalue from table1

9平均:

select avg(field1) as avgvalue from table1

10 最大值:

select max(field1) as mxvalue from table1

11最小值

 select min(field1) as minvalue from table1

你可能感兴趣的:(测试,软件测试,面试,sql,职场和发展)