mdsk.net
当前位置:首页 >> sql数据库查询语句大全 >>

sql数据库查询语句大全

1、说明:创建数据库 CREATE DATABASE database-name 2、说明:删除数据库 drop database dbname 3、说明:备份sql server --- 创建 备份数据的 device USE master EXEC sp_addumpdevice 'disk', 'testBack', 'c:\mssql7backup\MyNwind_1.dat' -...

--读取库中的所有表名select name from sysobjects where xtype='u'--读取指定表的所有列名select name from syscolumns where id=(select max(id) from sysobjects where xtype='u' and name='表名')

1. Oracle数据库 SELECT * FROM TABLENAME WHERE ROWNUM

查询范围在SQL语句中需要用between ...and或者>=及=2 and id

select * from tab_name where 组号='001组' and to_char(日期,'yyyy-mm-dd')='2013-04-15' and 姓名1='小王' union all select * from tab_name where 组号='001组' and to_char(日期,'yyyy-mm-dd')='2013-04-15' and 姓名2='小王' union all s...

group by tb_prodcut.pid ,pname,photo,price,pnums,salenums,mess 你需要group全部的列。

: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...

可以用下面的语句 --把表名和字段名换下。

1select cno,cname from course2select sname,year(getdate())-sage from student3select * from student where sage3)14select sno,cno from sc a,(select cno,avg(grade) avg_grade from sc group by cno) bwhere a.cno=b.cno and a.grade

是SQLSERVER吧?简单点的方法就是用系统存储过程sp_helpdbexecsp_helpdb数据库名比如execsp_helpdbdb1

网站首页 | 网站地图
All rights reserved Powered by www.mdsk.net
copyright ©right 2010-2021。
内容来自网络,如有侵犯请联系客服。zhit325@qq.com