SQL2005查询语句

来源:百度知道 编辑:UC知道 时间:2024/06/05 06:28:16
1. 题目:选取B表中没有而A表中有的数据。
2. 题目:删除表中重复记录。
3. 题目:查找商品价值最高的前三名。
4. 题目:显示文章题目、提交人和最后回复时间。
5. 题目:查询表中前10条记录。
6. 题目:写出一条SQL语句:取出表A中第31~40记录。

刚注册不久的号 ,没多少积分 有没人能帮帮忙 这些对于大神们来说都是小菜
拜托了。

1.
select * from B where id not in (select id from a)
2.
delete from 表名 a where 字段1,字段2 in
(select 字段1,字段2,count(*) from 表名 group by 字段1,字段2 having count(*) > 1)
3.
select top 3 price from a order by price desc
4.
select 文章题目,提交人,最后回复时间 from a
5.
select top 10 * from a
6.
select top 10 * from a where id not in (select top 30 id from a)

学习~~

1.select * from A where id not in(select id from b)