server2005 函数学习
wangzhantao
这个作者很懒,什么都没留下…
展开
-
有用的SQL
1 删除、添加、更改表结构 Alter table dictionary Drop Column dic_id ; Alter table dictionary Add dic_id Int IDENTITY(1,1) ; Alter table student Add isValidate int default(1) not null; --加了 d...原创 2013-06-03 14:43:04 · 68 阅读 · 0 评论 -
server2005 存储过程
测试表结构 CREATE TABLE [BASE_ADMIN_USER]( [userID] [int] NOT NULL PRIMARY KEY , [userName] [varchar](16) NOT NULL, [password] [varchar](16) NOT NULL, [userType] [smallint] NOT NULL, [realN...原创 2013-06-26 18:04:10 · 81 阅读 · 0 评论 -
数据库
--聚合函数 use pubs go select avg(distinct price) --算平均数 from titles where type='business' go use pubs go select max(ytd_sales) --最大数 from titles go use pubs go select min(ytd_sales...原创 2012-09-24 14:19:17 · 75 阅读 · 0 评论 -
sqlserver 日期格式化例子
year( uptime ) 取出日期的年 month(uptime) 日期的月 CONVERT(varchar(10), uptime, 120 ) 取出日期 时间转换: convert(datetime,'2006-04-01') 转换成时间字符串 convert(varchar(10),getdate(),23) ----...原创 2012-10-15 14:25:29 · 252 阅读 · 0 评论 -
SQl server中端口无法连接问题
SQL Server中一般默认端口是1433,但有时候遇到无法连接问题,需要检查1433是否可以启用: 方法: 开始->cmd-> 回车telnet localhost 1433 –》回车出现黑屏就可以用。 1 telnet不能用,则需要安装telnet的服务 2 1)修改1433 端口 <!--[endif]--> 2)启用其中的...原创 2015-01-09 18:29:36 · 305 阅读 · 0 评论