Table schema:
CREATE TABLE table_name_38 (total VARCHAR, average_annual VARCHAR)

Question: What is the average value for 2005, when the value for 2008 is greater than 0, when the value for 2007 is greater than 310, when the Average annual is 767, and when the Total is greater than 4,597?
SQL: SELECT AVG(2005) FROM table_name_38 WHERE 2008 > 0 AND 2007 > 310 AND average_annual = 767 AND total > 4 OFFSET 597