🎴 Flashcard Mode

Oracle SQL Functions and Queries

Card1 / 20
Mastered0
Review0
QuestionClick to flip

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

AnswerClick to flip back
A
3 rows
💡 Explanation:

ROWNUM IN (1,3,3,2) behaves similarly to ROWNUM IN (1,2,3) after deduplication. The first row gets ROWNUM=1 (matches), second row gets ROWNUM=2 (matches), third row gets ROWNUM=3 (matches). Rows 4-30 get ROWNUM values >3 and don't match. Thus, 3 rows are returned.

Change Mode