如何更新mysql数据库中datetime类型的字段
1个回答
2017-08-18
展开全部
如何更新mysql数据库中datetime类型的字段
-- 比如datetime字段为:<a href="https://www.baidu.com/s?wd=sj&tn=44039180_cpr&fenlei=mv6quAkxTZn0IZRqIHckPjm4nH00T1YLnHbvrAn1PWu9ujcsPWbY0ZwV5Hcvrjm3rH6sPfKWUMw85HfYnjn4nH6sgvPsT6KdThsqpZwYTjCEQLGCpyw9Uz4Bmy-bIi4WUvYETgN-TLwGUv3EnHDLPHR3Pjm4nWTkrjcdn16drf" target="_blank" class="baidu-highlight">sj</a>
update 表名 set <a href="https://www.baidu.com/s?wd=sj&tn=44039180_cpr&fenlei=mv6quAkxTZn0IZRqIHckPjm4nH00T1YLnHbvrAn1PWu9ujcsPWbY0ZwV5Hcvrjm3rH6sPfKWUMw85HfYnjn4nH6sgvPsT6KdThsqpZwYTjCEQLGCpyw9Uz4Bmy-bIi4WUvYETgN-TLwGUv3EnHDLPHR3Pjm4nWTkrjcdn16drf" target="_blank" class="baidu-highlight">sj</a> = now() where 条件; //now()是当前本地年月日时分秒
update 表名 set <a href="https://www.baidu.com/s?wd=sj&tn=44039180_cpr&fenlei=mv6quAkxTZn0IZRqIHckPjm4nH00T1YLnHbvrAn1PWu9ujcsPWbY0ZwV5Hcvrjm3rH6sPfKWUMw85HfYnjn4nH6sgvPsT6KdThsqpZwYTjCEQLGCpyw9Uz4Bmy-bIi4WUvYETgN-TLwGUv3EnHDLPHR3Pjm4nWTkrjcdn16drf" target="_blank" class="baidu-highlight">sj</a> = '2014-10-10 12:00:00' where 条件;
-- 比如datetime字段为:<a href="https://www.baidu.com/s?wd=sj&tn=44039180_cpr&fenlei=mv6quAkxTZn0IZRqIHckPjm4nH00T1YLnHbvrAn1PWu9ujcsPWbY0ZwV5Hcvrjm3rH6sPfKWUMw85HfYnjn4nH6sgvPsT6KdThsqpZwYTjCEQLGCpyw9Uz4Bmy-bIi4WUvYETgN-TLwGUv3EnHDLPHR3Pjm4nWTkrjcdn16drf" target="_blank" class="baidu-highlight">sj</a>
update 表名 set <a href="https://www.baidu.com/s?wd=sj&tn=44039180_cpr&fenlei=mv6quAkxTZn0IZRqIHckPjm4nH00T1YLnHbvrAn1PWu9ujcsPWbY0ZwV5Hcvrjm3rH6sPfKWUMw85HfYnjn4nH6sgvPsT6KdThsqpZwYTjCEQLGCpyw9Uz4Bmy-bIi4WUvYETgN-TLwGUv3EnHDLPHR3Pjm4nWTkrjcdn16drf" target="_blank" class="baidu-highlight">sj</a> = now() where 条件; //now()是当前本地年月日时分秒
update 表名 set <a href="https://www.baidu.com/s?wd=sj&tn=44039180_cpr&fenlei=mv6quAkxTZn0IZRqIHckPjm4nH00T1YLnHbvrAn1PWu9ujcsPWbY0ZwV5Hcvrjm3rH6sPfKWUMw85HfYnjn4nH6sgvPsT6KdThsqpZwYTjCEQLGCpyw9Uz4Bmy-bIi4WUvYETgN-TLwGUv3EnHDLPHR3Pjm4nWTkrjcdn16drf" target="_blank" class="baidu-highlight">sj</a> = '2014-10-10 12:00:00' where 条件;
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询