sql server中sql语句(二)
复制表
select * into new_table from old_table;
select * into new_table from old_table where 1=2;
数据转化
cast(列名 as 要转化成的数据类型[(长度)])
条件判断
case when 判断语句 then '值1' else '值2' end
还有一种限定布尔类型列的方式
case 列名 when 1或0(1是true) then '值1' else '值2' end