datetime类型转换为int类型
A表的a字段类型为datetime,b字段类型为int.如何在查询分析器中,使用sql语句将a字段中日期的年份值转换到b字段中?
转换前:
a b
2000-2-1 null
2001-3-8 null
2005-10-10 null
转换后:
a b
2000-2-1 2000
2001-3-8 2001
2005-10-10 2005
拜托高手给出完整的sql语句阿。。谢谢。。
转换前:
a b
2000-2-1 null
2001-3-8 null
2005-10-10 null
转换后:
a b
2000-2-1 2000
2001-3-8 2001
2005-10-10 2005
拜托高手给出完整的sql语句阿。。谢谢。。
...全文


应用实例
