现有表如下
视图1serviceorder
各列分别为 
ordertype ordertypename accounttype accounttypename num
1 会诊服务 1 白金卡      23
1 会诊服务 2 外服卡      10
1 会诊服务 3 体验卡 7
2 病后跟踪        1       白金卡 14
3 特种检查        2 外服卡        85
group by 前面四列,后面的num为统计数据表1 ordertype
ordertype ordertypename
1 会诊服务
2 病后跟踪
3 特种检查
4               投诉申请表2 accounttype
accounttype accounttypename
1             白金卡
2             外服卡
3             体验卡
4             百医通卡现在要求组成数据如下
ordertype  ordertypename      accounttype1 accounttypename1 num1 accounttype2 accounttypename2 num2 accounttype3 accounttypename3  num3  accounttype4 accounttypename4 num4  
1 会诊服务       1           白金卡       23         2       外服卡         10     3              体验卡        7      4               百医通卡     0      
2 病后跟踪
3 特种检查
4               投诉申请也就说,横和列的个数分别是跟据表1和表2动态生成的,排版有问题,不好意思,它自动换行了.
用什么方法都行,能达到这个效果就好.谢谢