[导入]SQL语句Select,Delete,Update

选择:
[code]select * from table1 where 范围[/code]
插入:
[code]insert into table1(field1,field2) values(value1,value2)[/code]
删除:
[code]delete from table1 where 范围[/code]
更新:
[code]update table1 set field1=value1 where 范围[/code]
查找:
[code]select * from table1 where field1 like ’%value1%’[/code] ---like的语法很精妙,查资料!
排序:
[code]select * from table1 order by field1,field2 [desc][/code]
总数:
[code]select count as totalcount from table1[/code]
求和:
[code]select sum(field1) as sumvalue from table1[/code]
平均:
[code]select avg(field1) as avgvalue from table1[/code]
最大:
[code]select max(field1) as maxvalue from table1[/code]
最小:
[code]select min(field1) as minvalue from table1[/code]
文章来源:http://localhost/blog/read.php?5
posted @ 2007-06-13 00:29  zeus2  Views(504)  Comments(0Edit  收藏  举报