I'm running into some problems trying to understand how I can do this. Let's say I'm running a lottery. Some tickets, or bunches of tickets will sometimes turn out void, which will be marked by a void flag in my database. Each ticket also has an individual number, along with a transaction id
.
For a report I would like to have these voided tickets split up into groups. These groups can be any size, be it numbers 1-2, or 100-560. Having these groups makes discarding these tickets much easier, rather than sifting through for individual numbers. For example, lets say I sell 1000 tickets, from 1-1000. Bunches 10-36, 100-164, and 276-340 are all void.
How can I get my report to display that as follows:
Lottery Name| Voided Ticket Series
Lucky 7 | 10-36
Lucky 7 | 100-164
Lucky 7 | 276-340
I have some tables in place, they have the following data structures. The void tickets table is as follows:
Ticket # | Transaction_ID | Seller_ID |
and the transaction table:
Transaction_ID | Seller_ID | Asset_ID | Lottery_name
One way to do it in Oracle, cribbed from here: