SQL语句拼装(高手来!!!)

来源:百度知道 编辑:UC知道 时间:2024/05/30 22:22:23
select * from student where ????????
只修改where 后的语句,实现查询表student的记录数,使其结果与
select count(*) from student的结果相同。
在Oracle数据库中

很遗憾的告诉你 如果不更改前面的select * from student这部分,就实现不了与select count(*) from student相同的结果 除非你的数据库只有一个字段

select * from student where 性别 ='男' or 性别='女'

select *,count(ID)over() as 总记结果录数 from student where ..

--or

select *,(select count(*) from student) from student where ..

select * from student where

1=1

select * from student where 0<1

为什么要在where后面呢,不要不可以吗?
select max(rownum) from student
或者
select * from student
where rownum=(select count(*) from student )