SQL Language (MOSC)

MOSC Banner

Rowid weird behaviour

edited Mar 29, 2023 2:39PM in SQL Language (MOSC) 9 commentsAnswered

Hi All,

I encountered a weird behavior on the rowid below


>select count(distinct dt.rowid) from table_a dt, table_b h
 where dt.sn = h.sn and dt.so = h.so ;

COUNT(DT.ROWID)
---------------
     10671

>select count(rowid) from table_a a where a.rowid in (select dt.rowid from table_a dt, table_b h
 where dt.sn = h.sn and dt.so = h.so );

 COUNT(rowid)
----------
   7237    ==> Less rows than the first query

I have 10671 rows of different rowid in 1st query, however, when I use the rowid to select the same table as in 2nd query, less count returned.

Howdy, Stranger!

Log In

To view full details, sign in to My Oracle Support Community.

Register

Don't have a My Oracle Support Community account? Click here to get started.

Category Leaderboard

Top contributors this month

New to My Oracle Support Community? Visit our Welcome Center

MOSC Help Center