--distinct(去除重复数据)select distinct Time from HightTable--Between select * from HightTable where ID BETWEEN 1 and 2 --orselect * from HightTable where ID=1 or ID=2--and和or结合select * from HightTable where (ID=1 or ID =2) and ID=1--order by和排序(降序)select
1.创建一个返回结果集的存储过程 create procedure firstpro As begin select * from dbo.Person End 执行: execute dbo.firstpro 如下图: 2.创建一个要求输入一个输入参数的存储过程 create procedure twopro ) --定义一个输入参数 as select * from dbo.Person where Id = @Id --要求Id列与输入的参数相等 执行: ’ 如下图: 3.创建一个要求输入
1.数据库管理工具 工具创建数据库 1>登录数据库管理工具[Microsoft SQL Server Management Studio] 2>右键[新建数据库] 3>数据数据库名称,点击确定,就建立好了一个[MyDB]的数据库 创建数据表 代码创建数据库,以及数据表 代码创建数据库 use master--用系统数据库 go if exists(select * from sys.sysdatabases where name='MyDB')--查询MyDB数据库是否存在 begin