行转列

 

select *
from (select borrowId,month(repayDate) months , hasPI from t_repayment) as ord
pivot(sum(hasPI) for months in([12],[1],[2],[3]))as p

posted @ 2016-04-13 11:19  595824023  阅读(100)  评论(0编辑  收藏  举报