SELECT p.stud_id,p.name,s.course_id,s.grade
FROM stud_info p,stud_grade s
WHERE p.stud_id>s.stud_id
这是书上的SQL语句,运行没有记录,不懂,求解释。
FROM stud_info p,stud_grade s
WHERE p.stud_id>s.stud_id
这是书上的SQL语句,运行没有记录,不懂,求解释。
insert into @table1
select 1,'a' union all
select 2,'b' union all
select 3,'c'
declare @table2 table (id int,col varchar(1))
insert into @table2
select 2,'d' union all
select 3,'e' union all
select 4,'f'select * from @table1 a,@table2 b where a.id>b.id
/*
id col id col
----------- ---- ----------- ----
3 c 2 d
*/
>
stud_grade--stud_id 最大值 (查看一下此表是否没有记录)