T-sql 查询分析器显示时间格式的问题 convert(varchar(20) , @temp , 120) 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 @temp是字符型的吧把@temp定义成datetime类型是最简单的方法 select convert(varchar(20) , @temp , 120) select convert(char(16),@temp,120) dt select getdate()declare @temp varchar(30)set @temp=getdate()select @tempdeclare @temp1 datetimeset @temp1=getdate()select @temp1--结果 ------------------------------------------------------ 2008-02-15 16:50:43.217(所影响的行数为 1 行) ------------------------------ 02 15 2008 4:50PM(所影响的行数为 1 行) ------------------------------------------------------ 2008-02-15 16:50:43.217(所影响的行数为 1 行) 关于数据库表的设计问题 对于sql命名规范的一点疑问? xp系统安装的sqlserver 个人版,别的机子是不是无法注册我这台机子的sqlserver? 请问:我建了一个数据表里面有三个字段,在表设计窗口将主键列与时间列换了一个顺序位置时出错。 一个数据库问题? 请教一个SQL查询的问题,在线等 请问找一个字段中某3位数最大值的SQL语句应该如何写? 求一条简单的sql语句 请帮一下菜鸟关于SQL学习的问题 求助!!!!!! 如何写一个条件查询的SQL查询语句 job执行时间问题
set @temp=getdate()
select @tempdeclare @temp1 datetime
set @temp1=getdate()
select @temp1--结果
------------------------------------------------------
2008-02-15 16:50:43.217(所影响的行数为 1 行)
------------------------------
02 15 2008 4:50PM(所影响的行数为 1 行)
------------------------------------------------------
2008-02-15 16:50:43.217(所影响的行数为 1 行)