I need to set up a query that will split up a single record into multiple records based on values from multiple columns in a single table.
Right now, a current parcel record would read as:
table.tax_id table.CLASS 1 table.CLASS 2 table.CLASS 3 table.CLASS 4A table.CLASS 4B
03489 0 100 0 0 600
05695 0 0 100 300 0
I need to generate a sequence number for each record and then split them up according to class, so the above parcels would look like this instead:
table.tax_id table.CLASS table.VALUE table.SEQUENCE
03489 2 100 1
03489 4B 600 2
05695 3 100 1
05695 4A 300 2
I've tried CASE and IIF statements but couldn't get any of them to work. Any suggestions are very appreciated!