Home > database >  Rownum query result is empty?
Rownum query result is empty?

Time:10-12

Why use rownum query result is empty?
 SQL> Select * from mystudent; 

STUNO STUNAME STUAGE
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
1 zs 23
1 zs 23
2 ls 24
2 ls 24
3 ww 25

SQL> Select * from mystudent where rownum in (select min (rownum) from mystudent group by stuno);

Not selected row

SQL> Select * from mystudent where rowid in (select min (the rowid) as n the from mystudent group by stuno);

STUNO STUNAME STUAGE
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
2 ls 24
3 ww 25
1 zs 23

CodePudding user response:

Rownum just pseudo columns, can't do that

CodePudding user response:

In change to be less than or equal to try

CodePudding user response:

references to learning - turn on the second floor response:
change to be less than or equal to try in

The into less than or equal to syntax errors

CodePudding user response:

reference 1st floor biubiu ash response:
rownum just pseudo columns, can't use

I know that is false and inferior, according to the reason of my SQL statements should be true,

CodePudding user response:

reference zero, 4/f, miss reply:
Quote: refer to 1st floor biubiu ash response:

Rownum is the pseudo column, can't use

I know that is false and inferior, according to the reason of my SQL statements should be true,

Rownum cannot and aggregation function with together, you what is the purpose of this statement

CodePudding user response:

biubiu grey reference 5 floor response:
Quote: miss zero reference 4 floor response:
Quote: refer to 1st floor biubiu ash response:

Rownum is the pseudo column, can't use

I know that is false and inferior, according to the reason of my SQL statements should be true,

Rownum cannot and aggregation function with together, you what is the purpose of this statement


Have nothing to do with aggregate function should
 SQL> Select * from mystudent; 

STUNO STUNAME STUAGE
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
1 zs 23
1 zs 23
2 ls 24
2 ls 24
3 ww 25
SQL> Select * from tt;

NO
-- -- -- -- -- -- -- -- -- --
1
SQL> Select * from mystudent where stuno in (select stuno from tt)

STUNO STUNAME STUAGE
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
1 zs 23
1 zs 23
2 ls 24
2 ls 24
3 ww 25
SQL> Select * from mystudent where rownum in (select stuno from tt);

STUNO STUNAME STUAGE
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
1 zs 23
1 zs 23
3 ww 25


CodePudding user response:

f zero reference, miss reply:
Quote: refer to fifth floor biubiu ash response:

Quote: miss zero reference 4 floor response:
Quote: refer to 1st floor biubiu ash response:

Rownum is the pseudo column, can't use

I know that is false and inferior, according to the reason of my SQL statements should be true,

Rownum cannot and aggregation function with together, you what is the purpose of this statement


Have nothing to do with aggregate function should
 SQL> Select * from mystudent; 

STUNO STUNAME STUAGE
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
1 zs 23
1 zs 23
2 ls 24
2 ls 24
3 ww 25
SQL> Select * from tt;

NO
-- -- -- -- -- -- -- -- -- --
1
SQL> Select * from mystudent where stuno in (select stuno from tt)

STUNO STUNAME STUAGE
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
1 zs 23
1 zs 23
2 ls 24
2 ls 24
3 ww 25
SQL> Select * from mystudent where rownum in (select stuno from tt);

STUNO STUNAME STUAGE
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
1 zs 23
1 zs 23
3 ww 25



Rownum represents the number of lines, that is, for you have just the query result set how many line, must begin from 1 count, and it is continuous,
Select * from Scott. Emp t where rownum in 4-trichlorobenzene (1); The result is two lines, remove the 1 is blank,
Popular point is that you found out after just can have the result of the rownum, also is the serial number

CodePudding user response:

nullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnull
  • Related