标签:
上图表一
上图表二
实现表二 3列变成 表一的行效果下图
实现代码:
select a.LandID,
a.LandType,
a.FarmID,
a.StatusID,
a.LandCode,
a.LandName,
a.Comment,
b.UID,
c.ParaValue ‘PRICE‘,
d.ParaValue ‘STARTTIME‘,
b.ParaValue ‘ENDTIME‘
from farm_land_landdef a
LEFT JOIN farm_land_rentdetail b on a.LandID=b.LandID
LEFT JOIN farm_land_rentdetail c on a.LandID=c.LandID
LEFT JOIN farm_land_rentdetail d on a.LandID=d.LandID
where b.ParaID=‘ENDTIME‘ and c.ParaID=‘PRICE‘ and d.ParaID=‘STARTTIME‘;
标签:
原文地址:http://www.cnblogs.com/jiangyi666/p/5954629.html