1,id name avg nf
删除除了自动编号以外的,重复数据
2,创建一个索引
3,学生表 老师表 学生老师表
id name age id name age
stud_id tea_id
查询年龄在40以上的老师,年龄在12岁以上的学生
4,部门 表,。 员工表
id 部门名字。 id 员工名字
查询一个部门中有多少员工
5用sql查询语句1到100的奇数和
lihualuo
2014/3/3 11:56:44
你前面几个问题表述有问题啊,表的名称没说啊。最后一个是
SELECT SUM(rn) AS Expr1
FROM (SELECT (SELECT COUNT(*)
FROM sysobjects
WHERE id < a.id) AS rn
FROM sysobjects a) b
WHERE (rn <= 100) AND (rn % 2 <> 0)
设表的名称为TABLE,
1,delete from TABLE
where name in (select name from TABLE group by name having count(name ) > 1)
and avg in (select avg from TABLE group by avg having count( avg ) > 1)
and nf in (select nf from TABLE group by nf having count( nf ) > 1)
2, create index table
g393863105
2014/3/4 12:26:28
3 ,select name from 学生表 where age >12
select name from 老师表 where age >40