高手请教啊,,怎么用sql 语句 把表1 里面的数据查询出来显示的是表2 的样式??高手来啊

回答对的打分送上... 回答对的打分送上 展开
 我来答
迷人的反派丶
2012-02-14 · 超过31用户采纳过TA的回答
知道答主
回答量:64
采纳率:0%
帮助的人:92.5万
展开全部
假设表1的3个字段名字分别为name,date,score
select distinct name,
(select score from table1 where a.name=name and date='14')as '14',
(select score from table1 where a.name=name and date='15')as '15',
(select score from table1 where a.name=name and date='16')as '16'
from table1 a
大概这样吧,你试试先
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式