/*This SQL script uses Demos.abs database. 
  Please open ...\AbsoluteDatabase\Demos\Data\Demos.abs database file.
  This sample illustrates use of HAVING clause.
  The query retrieves average ticket price for every venue using events that happened before.*/

select e1."VenueNo", avg(e1."Ticket_price") as "avgTicket_price"
  from "events" e1
 group by e1."VenueNo"
 having ((e1."Event_Date" < now))
