菜鸟一个简单的查询问题,望各位大哥帮忙
select * from test;
NAME SUBJECT MARK
---------- -------------------- -----------
andy english 81
andy chinese 79
andy physics 90
lili chinese 85
lili english 91
Abel english 78
Abel chinese 97
要查询每门成绩大于80分的NAME,大哥大姐帮帮小弟
------解决方案--------------------select name from test where MARK> 80
*****************************************************************************
欢迎使用CSDN论坛专用阅读器 : CSDN Reader(附全部源代码)
最新版本:20070130
http://www.cnblogs.com/feiyun0112/archive/2006/09/20/509783.html
------解决方案--------------------select * from test Where MARK> 80
------解决方案--------------------楼上已解
------解决方案--------------------select distinct Name from test Where MARK> 80
------解决方案--------------------select * from test where name not in (select name from tb where MARK < 80)
------解决方案--------------------select name from @a group by name having min(mark)> 80
------解决方案--------------------CREATE TABLE [A] (
[NAME] varchar(20),
SUBJECT varchar(20),
MARK int
)
INSERT INTO A
SELECT 'andy ', 'english ',81 UNION ALL
SELECT 'andy ', 'chinese ',79 UNION ALL
SELECT 'andy ', 'physics ',90 UNION ALL
SELECT 'lili ', 'chinese ',85 UNION ALL
SELECT 'lili ', 'english ',91 UNION ALL
SELECT 'Abel ', 'english ',78 UNION ALL
SELECT 'Abel ', 'chinese ',97