请问这样的sql语句应该怎么写??折磨我好多天了 高手赐教!! select a.xm,a.xb,a.bj,b.kcmc,b.cj from student a inner join score b on a.xm=b.xm and b.cj>=60 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 select a.xm,a.xb,a.bj,b.kcmc,b.cj from student a , score b where a.xm=b.xm and b.cj>=60 楼上两位误解我的意思了应该我是说从基本信息表student中找出这样符合条件的人应该怎么办呢? 好像不难吧SELECT * FROM student WHERE NOT xm IN(SELECT xm FROM score WHERE cj<60) SELECT * FROM student WHERE xm NOT IN(SELECT xm FROM score WHERE cj<60) SELECT * FROM student WHERE xm NOT IN(SELECT xm FROM score WHERE cj<60) select * from student where xm not in(select distinct(t.xm) from score t where t.cj<60) select * from studentwhere xm in(select xm from score group by xm having min(cj)>=60)order by bj select * from student aawhere not exists(select * from score where cj<'60' and xm=aa.xm) declare @score table(xm varchar(10),kc varchar(10),cj varchar(10))insert @score select '张三','英语' ,'60'insert @score select '张三','语文',' 80'insert @score select '张三',' 数学','55'insert @score select '李四' ,'英语','60'insert @score select '李四', '语文', '60'insert @score select '李四', '数学', '60'select * from @score where xm not in(select xm from @score where cj<60) to hanyefei ():楼主,好像是我第一个说出来的啊。一分都没有,很不给面子吧! update jion 多表 高手来看看 sql 查询的问题 N个数据库间定期导数据的问题,怎么实现 散100分 创建一个触发,在本地数据库添加一个记录的时候,在远程服务器上添加一个相同的记录 select themeId from t_theme 很头痛的查询问题,求解 谈谈对索引的理解…… 怎么创建约束 j9988或其它大侠请进来帮忙,存储过程优化问题 一个救命的问题! 关于作业的问题??? 怎样断开指定数据库的所有连接(sql命令)
我是说从基本信息表student中找出这样符合条件的人
应该怎么办呢?
(SELECT xm FROM score WHERE cj<60)
(SELECT xm FROM score WHERE cj<60)
(SELECT xm FROM score WHERE cj<60)
where xm in(select xm from score
group by xm
having min(cj)>=60)
order by bj
where not exists(select * from score where cj<'60' and xm=aa.xm)
insert @score select '张三','英语' ,'60'
insert @score select '张三','语文',' 80'
insert @score select '张三',' 数学','55'
insert @score select '李四' ,'英语','60'
insert @score select '李四', '语文', '60'
insert @score select '李四', '数学', '60'select * from @score where xm not in(select xm from @score where cj<60)
楼主,好像是我第一个说出来的啊。
一分都没有,很不给面子吧!