Multiple choice technology databases

How many rows records the following query will display.. select * from TEMP where rownum in (1,3); N.R. Temp table has 30 records

  1. 1 row

  2. NULL

  3. 0 row

  4. 3 rows

  5. 30 rows

  6. 2 rows

Reveal answer Fill a bubble to check yourself
A Correct answer
Explanation

ROWNUM conditions have special behavior. ROWNUM IN (1,3) only matches the first row because ROWNUM = 1 is true for the first row, but when checking ROWNUM = 3, the third row never gets ROWNUM = 3 (it fails at 1 or 2). Only the first row satisfies ROWNUM = 1, so exactly 1 row is returned.