SnowPro Core Certification — Question 541
Which function should be used to find the query ID of the second query executed in a current session?
Answer options
- A. Select LAST_QUERY_ID(-2)
- B. Select LAST_QUERY_ID(-1)
- C. Select LAST_QUERY_ID(1)
- D. Select LAST_QUERY_ID(2)
Correct answer: D
Explanation
The correct answer is D, as LAST_QUERY_ID(2) retrieves the ID of the second query in the session. Options A and B reference negative indices, which indicate the most recent queries, and C references the first query, making them incorrect for this question.