我需要帮助来编写ANSI SQL(Oracle数据库)。我有一张名为'机会'它有以下列和数据:
| Opp Name | Amount | Is Recurring | Start Date | End Date |
| Emily | £350 | Y | 11-AUG-2017 | 15-JUL-2018|
| Andrew | £1200 | N | 10-MAR-2017 | 10-MAR-2017|
如果机会重复发生(它的重复标记=' Y'),查询应返回从开始日期开始到达到结束日期的每个月的金额。也就是说,每月一行数据。如果机会不再发生(重复标记=' N'),则只需要一行数据。 [在数据库中,如果重复标记=' N'然后结束日期与开始日期相同]
这是所需的输出:
|Opp Name | Amount | MONTH |
| Emily | £350 | AUG |
| Emily | £350 | SEP |
| Emily | £350 | OCT |
| Emily | £350 | NOV |
| Emily | £350 | DEC |
| Emily | £350 | JAN |
| Emily | £350 | FEB |
| Emily | £350 | MAR |
| Emily | £350 | APR |
| Emily | £350 | MAY |
| Emily | £350 | JUN |
| Emily | £350 | JUL |
| Andrew | £1200 | MAR |
我不知道如何处理这个问题。任何帮助将不胜感激。