Skip to content

Latest commit

 

History

History
13 lines (10 loc) · 334 Bytes

SQL小知识.md

File metadata and controls

13 lines (10 loc) · 334 Bytes

SQL小知识

sqlserver中将varchar类型转换为int型

select * from TableName order by cast(colName as int); 
 
select * from TableName order by convert(int,colName);

select语句中1/0与男/女的转换

SELECT *,CASE Ssex WHEN '' THEN '0' ELSE '1' END AS sex FROM student