human
Considering the provided database schema and associated query, produce SQL code to retrieve the answer to the query. 
###Database Schema: Wins, Byes, Losses, Draws, Against
###Question: What is the average number of Byes when there were less than 0 losses and were against 1247?
gpt
SELECT AVG Byes FROM table WHERE Against = 1247 AND Draws < 0