QuestenaՎարժանք, որը ցույց է տալիս՝ ինչ կրկնել հաջորդիվ
Հարց 18

In PostgreSQL 18, how many rows does SELECT g, count(*) FROM m WHERE false GROUP BY g; return, given that the WHERE clause removes every row?

  1. 1
  2. 0Ճիշտ պատասխան
  3. One row for each distinct g value stored in m
  4. It raises an error

Բացատրություն

GROUP BY emits one row per group, and an empty input contains no groups, so the result set is empty. The contrast with the ungrouped case is what surprises people: drop the GROUP BY and the same empty input still yields exactly one row.

Շարունակեք այս թեստով

Սկսել վարժանքը
Հարց 18: In PostgreSQL 18, how many rows does SELECT g, count(*)… · SQL: NULL, Joins and Aggregates · Questena