How would I get all friends greater than the average age?
CREATE TABLE friends ( firstname CHAR(15), lastname CHAR(20), age INTEGER)
SELECT firstname, lastnameFROM friendsHAVING age >= AVG(age)ERROR: Attribute friends.firstname must be GROUPed or used
inanaggregate function
This fails too:
SELECT firstname, lastnameFROM friendsWHERE age >= AVG(age)ERROR: Aggregates not allowed in WHERE clause
This fails. I am stumped.
-- Bruce Momjian | http://www.op.net/~candle maillist@candle.pha.pa.us | (610)
853-3000+ If your life is a hard drive, | 830 Blythe Avenue + Christ can be your backup. | Drexel Hill,
Pennsylvania19026