佳礼资讯网

 找回密码
 注册

ADVERTISEMENT

查看: 1005|回复: 2

请教sql一下

[复制链接]
发表于 28-8-2006 05:36 PM | 显示全部楼层 |阅读模式
如何写
multiple rows with same value in one column to multiple columns with 1 row
example
id       subject      status
1        math          pass
1          chinese    pass
2          math          pass
2           chinese         pass

change it to the structure below

id math chinese
1     pass pass
2        pass pass

[ 本帖最后由 stephanie83 于 28-8-2006 05:38 PM 编辑 ]
回复

使用道具 举报


ADVERTISEMENT

发表于 28-8-2006 07:28 PM | 显示全部楼层
原帖由 stephanie83 于 28-8-2006 05:36 PM 发表
如何写
multiple rows with same value in one column to multiple columns with 1 row
example
id       subject      status
1        math          pass
1          chinese    pass
2          math          pass
2           chinese         pass

change it to the structure below

id math chinese
1     pass pass
2        pass pass


你是要重新设计更好的table(s) structure,
还是alter 现有的table structure, 以把现有data record update去alter后的table structure?
回复

使用道具 举报

 楼主| 发表于 29-8-2006 09:38 AM | 显示全部楼层
原帖由 亡者之疯 于 28-8-2006 07:28 PM 发表


你是要重新设计更好的table(s) structure,
还是alter 现有的table structure, 以把现有data record update去alter后的table structure?


我是要把之前已有的table structure
换去alter 后的table structure
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

 

ADVERTISEMENT



ADVERTISEMENT



ADVERTISEMENT

ADVERTISEMENT


版权所有 © 1996-2023 Cari Internet Sdn Bhd (483575-W)|IPSERVERONE 提供云主机|广告刊登|关于我们|私隐权|免控|投诉|联络|脸书|佳礼资讯网

GMT+8, 23-9-2024 03:32 PM , Processed in 0.105049 second(s), 24 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表