SQL SERVER自动在前面补0满足10位请问怎么写?

select right(cast('000000000'+rtrim(RowNo) as varchar(20)),10),* from (
select row_number() over (order by b.a5 desc) as RowNo,b.a5,c.a3,c.a5 qy,b.a11,b.a12,b.a36 from t_ht a  
    inner join t_khda b on a.fk_guid=b.guid 
    inner join t_ygda_gh c on b.id=c.guid 

 

right(cast('000000000'+rtrim(RowNo) as varchar(20)),10)

你可能感兴趣的:(SQL SERVER自动在前面补0满足10位请问怎么写?)