SQL修改日期时间型数据中的年月日
以下语句为更改 tevent表中的eventtime字段为2011-7-16当eventtime为2012-02-29时
update tevent set eventtime='2011-7-16'+right(convert(varchar(23),eventtime,121),13) where convert(varchar(10),eventtime,121)='2012-02-29 '
以下语句为根据eventid字段的值来更改eventtime的值为'2011-01-01'
update tevent set eventtime='2011-01-01'+right(convert(varchar(23),eventtime,121),13) where eventid >=11 and eventid <= 20
SQL修改日期时间型数据中的年月日的更多相关文章
- sql server日期时间转字符串
一.sql server日期时间函数Sql Server中的日期与时间函数 1. 当前系统日期.时间 select getdate() 2. dateadd 在向指定日期加上一段时间的基 ...
- SQL Server日期时间格式转换字符串详解 (详询请加qq:2085920154)
在SQL Server数据库中,SQL Server日期时间格式转换字符串可以改变SQL Server日期和时间的格式,是每个SQL数据库用户都应该掌握的.本文我们主要就介绍一下SQL Server日 ...
- SQL Server日期时间格式转换字符串
在SQL Server数据库中,SQL Server日期时间格式转换字符串可以改变SQL Server日期和时间的格式,是每个SQL数据库用户都应该掌握的.本文我们主要就介绍一下SQL Server日 ...
- sql server日期时间转字符串(转)
一.sql server日期时间函数Sql Server中的日期与时间函数 1. 当前系统日期.时间 select getdate() 2. dateadd 在向指定日期加上一段时间的基 ...
- SQL Server日期时间格式转换字符串详解
本文我们主要介绍了SQL Server日期时间格式转换字符串的相关知识,并给出了大量实例对其各个参数进行对比说明,希望能够对您有所帮助. 在SQL Server数据库中,SQL Server日期时间格 ...
- sql server 日期时间与字符串的转换
一.sql server日期时间函数Sql Server中的日期与时间函数 1. 当前系统日期.时间 select getdate() 2. dateadd 在向指定日期加上一段时间的基 ...
- C#中使用DateTimePicker控件显示修改日期时间
1.只显示日期 默认就是 2.只显示时间 修改属性 Format 设为Time ShowUpDown设为true 3.同时显示日期时间 Format设为Custom CustomF ...
- sql server日期时间函数
From:http://www.cnblogs.com/linzheng/archive/2010/11/17/1880208.html 1. 当前系统日期.时间 select getdate() ...
- (后端)SQL Server日期时间函数
转自博客园: 1.获取当前日期GetDate getdate()函数以datetime数据类型的格式返回当前SQLServer服务器所在计算机的日期和时间.其语法格式为getdate().返回值舍入到 ...
随机推荐
- 【P1582】倒水(数论??暴力!!)
这个题我很无语,一开始看绿题,还是数论,应该不会特别简单,应该要动笔写上好一会,过了一会旁边 #祝神 说这原来是个蓝题,我顿时觉得十分迷茫... 结果看了这个题看了一会,仔细一想,woc,这题怕不是可 ...
- spring boot 打包
打成jar直接运行比较简单,这里特别说明的是打成war包,部署在外部的tomcat方式: 1.修改启动代码 import org.springframework.boot.SpringApplicat ...
- js的值类型和引用类型
(1)值类型:String.Boolean.Number.null.undefined.(原始值) var a = 2; var b = a; b=3; a ==>2; b ==>3 原 ...
- numpy array或matrix的交换两行
A[j,:] = A[maxindex,:] # 注意这样是一个很低级的错误!这样只是赋值 我们很容易想起python中的两个值交换一句搞定不用引入中间变量 a, b = b, a 但在numpy的a ...
- libvirt cpu mode
libvirt中 cpu mode可以有以下3种: custom : 该模式下cpu element用来描述guest可见的CPU,该模式也是mode的default模式,它会使得persistent ...
- 读写properties文件方法
按key读取properties文件中的value public static String readSystemConfig(String key){ Properties prop = new P ...
- Tensorflow中的命名空间scope
1.name_scope 在tensorflow中有两种声明变量的方式,tf.get_variable()和tf.Variable(). name_scope对于tf.get_variable()无效 ...
- JAVA中的泛型类型不可以直接初始化
class Para<CLS>{ private CLS class1; public Para(CLS class1) { ...
- LeetCode OJ:Convert Sorted Array to Binary Search Tree(将排序好的数组转换成二叉搜索树)
Given an array where elements are sorted in ascending order, convert it to a height balanced BST. 讲一 ...
- java学习笔记--常用类
一.Math类:针对数学运算进行操作的类 1.常用的方法 A:绝对值 public static int abs(int a) B:向上取整 public static double ceil( ...