黑马程序员技术交流社区
标题:
行列转换问题
[打印本页]
作者:
王亮
时间:
2011-7-21 15:59
标题:
行列转换问题
一个表:
转换为
我们可以使用
decode
函数可以解决,但是这里我们知道每个学生都有三门课程,假如所有的课程都是选修课,数据表可能是这样:
[
本帖最后由 王亮 于 2011-07-23 13:37 编辑
]
作者:
匿名
时间:
2011-7-21 16:11
[img]data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAXYAAAC3CAIAAACJ/+KXAAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAA7EAAAOxAGVKw4bAAAKvklEQVR4nO3dYZKjIBCGYXdrT+EBc6gcMOfYH9ZQTDcgAq3QeZ8fWxknUcyGL4ja8+fz+WwAYOPv0w0A4BkRA8AQEQPAUCli9h/H44a1t73qTskWzt/sq/ztEVaRjZh93z8/4g9o/Ye14WN9c0/Ibe7qFPjkHXjy5sG3qgOltrNO85+rmr+FQ1zazff7bdcSfKF/lc87PqbhoCkMbeLl4aMsfowXxi9JruRY3r1fcouF1ibbL/ZF751ds8v7EjYt3kDdzq3uPwIwlY0Y0S3jhccS8bEOj8MTxOGV7qLxM8MR2cB8EYGSbK1uRqHZooUWzS7vi2ikaHlyd7bif8Tx+P1+v14vu/bjm5VGMbnv/EqFSZwbumW8rUtPqJ97enAUIN7AckvKe8SREUydHyjp78k2N3fI5CisbT2DWmSrfk433qOQL+EBwxmMlY2Y20YZdkaF4+NyUy1B8ji0xuv1OsKFZIGRk+tiKn+VvHYmd0HNaR8YcpL1tPFXt3K6I3bnhuMLCNpevuXbT7jA1J/cp1bMfebOFsWTqTULt/zM66hDG705sbDQsHjfC79NLrEbKyVPJ+VaFS+v3F/ATjZivtlsx1aiPbM1DyjgHiUAhhjF/GJ9yNNMnPJ/sCXAJUQMAEMcKAEwRMQAMETEADBExAAwRMQAMETEADBExAAwRMQAMETEADBExKyKanVYAhEDwBARsxJGLlgOEbMM8gUrKlW9Ox6IP5Rx+uOoZ9a0ZM5WWWxa5wsFMbEEijksg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DO4NjDNSl7Yuc9qN36Me8rbbLYrUeCAlqa/HpoezuQKEwlrYZX1KGz7ftd/RfyyFjYjlyKiaVZSrLd/79arjZ/2p3KtEprS04V45LiiUzEAZBHNvdb2zL30AqIZiJ3tftHHmt3+ARMTnyZhrXlScR8OcE/a+p3T1QfhH26eIn4V+CMwxErutTI17hDdabsdf5UPm6EYql/PtuxhTCvc9U+rZwyaFLSfhLUwihc3yWrPv8KjXo3CtjvjgjjqYYnRX88GZ+wjDNAFWgezdxUkrIUJDDV57Ig6ONQa8k1GFfkTyGinTR06RQQS1sIEdhTW6VHNyEJkp19tsMBOxM9rBo+ChwTRgdKqX/FKtoOOwCjd9Sba0xZhFLPbdHaWny3Q3NZB3L29JH/eRIQttD1+aKn31/i9LeHFIHHNMsdQ/sAKIAIr67srOPRMrVOJXyBuiVbVVf1CCOAiPF1NLsJjY1VwJ1ATAMjh0RkJACAR1AQAckBNAAAA4Er8+fv379k2AMAd+A/lS6AWL/Fo5QAAAABJRU5ErkJggg==[/img]
[font=宋体]这该怎么实现?请各位帮忙(由于图片的原因,容量太大,一个帖子发布不了,所以……)[/font]
欢迎光临 黑马程序员技术交流社区 (http://bbs.itheima.com/)
黑马程序员IT技术论坛 X3.2