数据库sql语句大全
数据库sql语句有哪些呢?下面就让我们一起来了解一下吧
sql语句有很多,比较基本的sql语句有
选择select from table1 where 范围
插入insert into table1(field1,field2) values(value1,value2)
删除delete from table1 where 范围
更新update table1 set field1=value1 where 范围
查找select from table1 where field1 like ’%value1%’
排序select from table1 order by field1,field2 [desc]
总数select count as totalcount from table1
求和select sum(field1) as sumvalue from table1
平均select avg(field1) as avgvalue from table1
最大select max(field1) as maxvalue from table1
最小select min(field1) as minvalue from table1
也还有其他的sql语句,具体介绍如下
若是备份sql server
1、创建、备份数据的 device,示例代码为
USE master
EXEC sp_addumpdevice 'disk', 'testBack', 'c:\mssql7backup\MyNwind_1.dat'
2、开始、备份,示例代码为
BACKUP DATABASE pubs TO testBack
若是创建新表
示例代码为
create table tabname(col1 type1 [not null] [primary key],col2 type2 [not null],..)
若是依照已有的表创建新表
示例代码为
Acreate table tab_new like tab_old (使用旧表创建新表)
Bcreate table tab_new as select col1,col2… from tab_old definition only
若是删除新表
示例代码为
drop table tabname
希望能够帮助到大家。
长沙网络推广
- 平凉整站优化:提升网站竞争力的关键
- 重庆百度关键词seo怎么做网络推广
- 松原关键词优化策略:提升您网站的可见性和流
- 万国数据备案域名出售:如何为您的业务选择合
- 兰州百度SEO排名:提升网站可见性的有效策略
- 山东优化关键词排名推广如何做百度排名
- 湟中百度优化服务:提升您网站排名的最佳选择
- 马关百度关键词SEO策略与实践指南
- 陕西SEO怎么做网站推广
- 花莲SEO优化:提升您网站排名的最佳策略
- 璧山SEO网站推广:有效提升你的网站流量与曝光
- 桂林优化关键词排名推广:提升您的在线能见度
- 崇信企业网站优化:提升您在线业务的秘密武器
- 江西SEO推广怎样跟客户谈判容易签下合同
- 为什么新网备案域名玩得开心?
- 开远百度关键词排名:提升你的网站可见度