sql查询
学生表:stuId stuName
1 张三
2 李四
课程表:courseId courseName
1 语文
2 数学
3 英语
成绩表:scoreId stuId courseId score
1 1 1 50
2 1 2 60
3 1 3 70
4 2 1 55
5 2 2 65
6 2 3 75
想要的结果:
姓名 语文 数学 英语
张三 50 60 70
李四 55 65 75
行列转换,见精华帖
相关问答:
今天做了一个存储过程 环境是SQL2000数据库
大致如下
建立临时表
定义员工游标
循环员工(属于1个公司)
......
从数据库中查询一张表的数据
select 部门,姓名 from tb
如何才能生成下面的xml格式
XML code:
<folder state="unchecked" label="全部">
<folder state="unchecked&qu ......
protected void btnLogin_Click(object sender, EventArgs e)
{
SqlConnection conn = new SqlConnection("Server = (local);user id = sa;pwd = 1;database = Login");
&nb ......
如何在SQL2005中设定定时作业,比如说定时清理某些表的数据,
或者是定时的将某些表的数据导出excel!
在线等待,急急急,最好是详细步骤!
之前我做的作业有点问题!
帮UP
参考:http://hi.baidu.com/toiota ......
字段1,字段2.....字段N,Status,ParentID
1,Name1....test1,1,99
1,Name1....test1,3,99
1,Name2....test2,1,101
1,Name2....test2,3,101
1,Name3....test3,2,101
1,Name1....test1,4,101
想要的结果是:
1,Na ......