jkinsley writes:

> When I add append GROUP BY p2.emp to the query, I no longer get the
> error and the results are returned.  Why must I explicitly declare a
> GROUP BY on the query?

Because otherwise it's undefined which p2.emp to return.  Consider this
table t1:

 a | b
---+---
 1 | 5
 6 | 2
 7 | 8

What should SELECT a, count(b) FROM t1 return?

-- 
Peter Eisentraut   [EMAIL PROTECTED]   http://funkturm.homeip.net/~peter


---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
    (send "unregister YourEmailAddressHere" to [EMAIL PROTECTED])

Reply via email to