human
Considering the provided database schema and associated query, produce SQL code to retrieve the answer to the query. 
###Database Schema: Nat., Name, Since, App(GS/Sub), Goals, Ends, Transfer fee
###Question: What is the greatest goals for Curtis Davies if ends is greater than 2012?
gpt
SELECT MAX Goals FROM table WHERE Name = curtis davies AND Ends > 2012