SQL问题求助

来源:百度知道 编辑:UC知道 时间:2024/09/21 04:10:31
比如我的日期是06-05 但是在数据库中写成了2007-06-05 数据有很多条
怎么把日期改回2006-05-01
用SQL脚本怎么写啊?

update table1
set date1='2006-05-01'
where date1='2007-06-05'

用上面的SQL语句就可以啦!

只能一个一个来了.
不能一次很多条数据同时更新....
像楼上所说那样..

<%
set rs=server.CreateObject("adodb.recordset")
sql="select * from 表名 where date='2006-06-05'"
rs.open sql,conn,3,3
if not (rs.bof and rs.eof) then
do while not rs.eof
rs("date")="2006-05-01"
rs.update
rs.movenext
loop
end if
%>

用sql plus连接上后
写update语句就可以了
如下:
update 表
set 字段='2006-05-01'
where 字段='2007-06-05'(如果此处你不确定是"=",可以用like)

update 表
set 字段='2006-05-01'
where 字段='2007-06-05'
可以全部一起修改的