可以傻傻的写
select name,(select score from t_test where name=o.name and lesson='语文') 语文,(select score from t_test where name=o.name and lesson='数学') 数学 from t_test o group by name
select name,(select score from t_test where name=o.name and lesson='语文') 语文,(select score from t_test where name=o.name and lesson='数学') 数学 from t_test o group by name
解决方案 »
- 输入相对于GMT的时区偏移量,求这个特定时区的时间,修改下面程序实现
- SSH问题
- java连接sql server?
- 请问Statement对象的stm.execute(sqlStr)用法怎样判断其格式不正确,即不是查询语句也不是更新等语句
- struts中如何对file文本框做检测
- 如何在jbuilder的struts项目里面插入resources文件,就是properties文件?
- 菜鸟问题~大侠帮忙
- 在SESSION BEAN中如何捕捉BMP的EJBException的异常抛出
- while语句中的表达式?
- 无法正常显示中文!!
- 关于结果集rs的一些问题,请教大侠们
- Struts 登陆带数据库的例子
http://topic.csdn.net/u/20080107/19/82918308-43be-4c39-8654-4cd8c0a0ac38.html
(case lesson when '数学' then score else '' end) as 数学,
(case lesson when '英语' then score else '' end) as 英语
from table
order by id
试试这样,我没有调试,不知道行不行,有问题再提吧