你连表名,字段都不发出来,怎么写?大概就是这样
select a.name,b.class from student a,class b where a.sno=b.sno and a.ssex=2;
select 姓名,年龄 from 表 where 年龄<(select min(年龄)from 表 where 系=CS系)
查询选修了全部课程的学生的姓名,用两种查询语句表示可以这么考袭虑!student学生bai表;course课程表;SC选课表du;Sno学号zhi;Sname学生dao姓名;Cno课程编号;法一:
selectSname
fromstudent
whereSnoIN(selectSno
fromSC
groupbySno
havingcount(*)=(selectcount(*)fromcourse))
法二:
selectSname
fromstudent-学生表
whereNOTexists(select*
fromcourse-课程表
whereNOTexists(select*
fromSC
where-选课表
Sno=student.sno
andcno=Courseo))
我知道在VBscript和SQL中有此函数。该函数的功能是执行参数中指定的代码。它的好处就是:执行的代码可以由用户输入或者程序生成,具有较高的灵活性。例如:用户输入学生的姓名,希望查询到该学生的个人信息。就可以使用该函数。由程序根据用户输入的学生姓名生成查询代码字符串,然后执行查询。declare@name char(10)
select@name='张三'
declare@selectText char(1000)
select@selectText='select*from students where name='''+name+''''
execute(@selectText)



