那位高手能帮我做下这个查询跪求,要求模糊查询!!!!
班级表(CLASS)
字段名          类型          描述
class_no    Varchar(10)   班级编号
class_name  Varchar(20)   班级名称学生表(student)
字段名             类型               描述
xh           Varchar(10)         学号      
xm           Varchar(20)         姓名
Birth_date   datetime            出生日期
Addr         Varchar(200)        家庭住址
Class_no     Varchar(10)         班级编号学生履历表(Stu-resume)
字段名             类型               描述
xh             Varchar(10)       学号
Start_date     Datetime          开始日期
End_date       datetime          结素日期
Content         Text             履历现在有两个问题:
问题1,
写SQL查询语句,查询姓‘李’的学生履历情况,显示格式如下,按照学号和开始日期进行排序。
学号     姓名       出生日期      开始日期        结束日期      履历
01      李三      1998.1.1    2000.1.2      2003.1.5    第一中学读初中
01      李三      1998.1.1    2003.2.1      2006.3.3    第一中学读高中
03      李四      1998.8.8    2000.1.2      2003.1.2    第一中学读初中
问题2;
统计出各班的人数,按班级编号排序,显示如下:
班级编号     班级名称      人数
02103      02级103班     4
02104      02级104班     8那位高手能帮小弟解决下跪谢!!!!

解决方案 »

  1.   

    http://topic.csdn.net/u/20080908/19/e42ae978-40db-4fc2-9eb5-98fae831a594.html
      

  2.   

    问题一:表连接
    问题二:Group by
      

  3.   

    我来试试
    问题一:
    select student.xh as 学号,student.xm as 姓名,student.birth_date as 出生日期,stu-resume.start_date as 开始日期,stu-resume.end_date as 结束日期,stu-resume.content as 履历 from student,stu-resume where student.xh=stu-resume.xh and student.xm like "李%" order by 学号,出生日期。
      

  4.   

    问题二:
    select class.class_no as 班级编号,class.class_name as 班级名称,count(student.xh) as 人数 from class,student where class.class_no=student.class_no group by 班级编号,班级名称 
    请指教。
      

  5.   

    问题一:Select a.xh as 学号,a.xm as 姓名, a.birth_date as 出生日期, b.Start_date as 开始日期, b.End_date as 结束日期, b.Content as 履历 from student a left join Stu-resume b on b.xh = a.xh where a.xm like '李%' 
      

  6.   

    问题一: Select a.xh as 学号,a.xm as 姓名, a.birth_date as 出生日期, b.Start_date as 开始日期, b.End_date as 结束日期, b.Content as 履历 from student a left join Stu-resume b on b.xh = a.xh where a.xm like '李%' order by a.xh, b.Start_date 
    用左联
      

  7.   

    问题二:select class.class_no as 班级编号, class.class_name as 班级名称, (Select count(*) from student where student.class_no = class.class_no) as 人数 from class order by class.class_no