SQL to generate ods for each number