SQLTeam.com | Weblogs | Forums

Grouping totals by state

I have a very complex (to me anyways) query problem I am unable to figure out.
In any one record I have the following:

STATE_1, STATE_2, STATE_3, STATE_4, STATE_5, STATE_6, STATE_7, STATE_8
DEF_GALS_1, DEF_GALS_2, DEF_GALS_3, DEF_GALS_4, DEF_GALS_5,... thru to _8
RFR_GALS_PURCH_1, RFR_GALS_PURCH_2, ... thru to _8
TRK_GALS_PURCH_1, TRK_GALS_PURCH_2, ... thru to _8

There can be a maximum of 8 unique entries per record (or trip) of all fuel stops (unique entries are required by Federal Mandate). I am attempting to look at each record, extract the data in those columns.

My end goal is to total all TRK_GALS etc. purchased in all states (using TN as an example immediately below) giving me a running total. It is very possible multiple fueling happens in the same State on the same load though each would have it's own entry within the record.

So the end goal would look like this:
STATE DEF GALS RFR GALS TRK_GALS
TN 50.00 120.00 512.00

Any one record can hold up to 8 fueling stops spread across multiple States.
ALL records for (example year 2020) needs to be looked at, look at each line in the record for the state, add that total to the overall total for the year for that state.

So assuming there are a total of 50 records (loads), of which 8 have at least one fuel stop in TN with 2 having more than 1 stop then I am needing the combined total of all TN stops output as shown.

I have tried multiple ways and am not getting what I am needing.

Maximum total lines expected to be returned would be 48 lines (prefer to have, but not necessarily require, output for all states even if no fueling exists in that State), one for each of the Continental US States. (hard to get a truck to Hawaii and we do not cross into Canada to get to Alaska)

So the final report would show all totals for the year purchased in any/all States looking something like:
STATE DEF GALS RFR GALS TRK_GALS
AL 0.00 0.00 114.00
AR 0.00 13.01 106.00
AZ 15.00 10.00 41.00
.....
KY 60.16 27.91 1798.76
MA 0.00 0.00 0.00
MI 0.00 0.00 132.00
MO 0.00 31.00 600.07

Additionally, I need the ability top drill down and pull the same output result for any specific month and/or quarter. I suspect that may become a separate query?

Can you provide DDL and sample data with expected output? The scenario you have is difficult to follow

1 Like

Best I am able to do... sorry.

Is the output desired in the picture above calculated with EXCEL formulas? Can you share them?

you can do better than that.

create table #sample(id int, name nvarchar(50), etc bit)

insert into #sample
select 1, 'smith', 0 union
select 2, 'kyle', 1
``

NO, the data was copied directly from the SQL table and put in EXCEL so you could see the data.

DDL for all fields other than STATE is decimal(7, 3). State is nvarchar(5)

The Desired Output screen is not accurate but reflects my desired outcome.

No clue what yosiasz is trying to convey other than being very abrupt.

Yeah, but we don't have access to your SQL. so either give us full access or sample data to emulate your data locally on our SQL Server. help us help you.

1 Like

I am not certain how to give you sample data from my database. I pulled the exact sample and put it into a excel file. Since I cannot upload an excel file I made a screenshot of same.

ID int Unchecked
ACTUAL_DH numeric(5, 0) Checked
ACTUAL_LOADED numeric(5, 0) Checked
ACT_MILES_DIFF numeric(5, 0) Checked
ACTUAL_REEFER_SURCHARGE money Checked
ACTUAL_SURCHARGE money Checked
ADJ_FUEL_CPG_1 money Checked
ADJ_FUEL_CPG_2 money Checked
ADJ_FUEL_CPG_3 money Checked
ADJ_FUEL_CPG_4 money Checked
ADJ_FUEL_CPG_5 money Checked
ADJ_FUEL_CPG_6 money Checked
ADJ_FUEL_CPG_7 money Checked
ADJ_FUEL_CPG_8 money Checked
ADJ_FUEL_COST money Checked
AVG_FUEL_COST money Checked
CARRIER_DH int Checked
CARRIER_LOADED int Checked
CARRIER_LOAD_NUMB nvarchar(15) Checked
CARRIER_SURCHARGE money Checked
COST_PER_GAL_1 money Checked
COST_PER_GAL_2 money Checked
COST_PER_GAL_3 money Checked
COST_PER_GAL_4 money Checked
COST_PER_GAL_5 money Checked
COST_PER_GAL_6 money Checked
COST_PER_GAL_7 money Checked
COST_PER_GAL_8 money Checked
COST_PER_MILE money Checked
DEF_ADJ_TOT_1 money Checked
DEF_ADJ_TOT_2 money Checked
DEF_ADJ_TOT_3 money Checked
DEF_ADJ_TOT_4 money Checked
DEF_ADJ_TOT_5 money Checked
DEF_ADJ_TOT_6 money Checked
DEF_ADJ_TOT_7 money Checked
DEF_ADJ_TOT_8 money Checked
DEF_ADJ_TOT money Checked
DEF_CARD_FEE_1 nchar(3) Checked
DEF_CARD_FEE_2 nchar(3) Checked
DEF_CARD_FEE_3 nchar(3) Checked
DEF_CARD_FEE_4 nchar(3) Checked
DEF_CARD_FEE_5 nchar(3) Checked
DEF_CARD_FEE_6 nchar(3) Checked
DEF_CARD_FEE_7 nchar(3) Checked
DEF_CARD_FEE_8 nchar(3) Checked
DEF_COST_1 money Checked
DEF_COST_2 money Checked
DEF_COST_3 money Checked
DEF_COST_4 money Checked
DEF_COST_5 money Checked
DEF_COST_6 money Checked
DEF_COST_7 money Checked
DEF_COST_8 money Checked
DEF_COST_TOT money Checked
DEF_CPG_1 money Checked
DEF_CPG_2 money Checked
DEF_CPG_3 money Checked
DEF_CPG_4 money Checked
DEF_CPG_5 money Checked
DEF_CPG_6 money Checked
DEF_CPG_7 money Checked
DEF_CPG_8 money Checked
DEF_CPG_TOT money Checked
DEF_FEE_AMT_1 money Checked
DEF_FEE_AMT_2 money Checked
DEF_FEE_AMT_3 money Checked
DEF_FEE_AMT_4 money Checked
DEF_FEE_AMT_5 money Checked
DEF_FEE_AMT_6 money Checked
DEF_FEE_AMT_7 money Checked
DEF_FEE_AMT_8 money Checked
DEF_FEE_AMT_TOT money Checked
DEF_GALS_1 decimal(7, 3) Checked
DEF_GALS_2 decimal(7, 3) Checked
DEF_GALS_3 decimal(7, 3) Checked
DEF_GALS_4 decimal(7, 3) Checked
DEF_GALS_5 decimal(7, 3) Checked
DEF_GALS_6 decimal(7, 3) Checked
DEF_GALS_7 decimal(7, 3) Checked
DEF_GALS_8 decimal(7, 3) Checked
DEF_GALS_PURCH_TOT decimal(7, 3) Checked
DH_MILES_DIFF int Checked
DISPATCH_DATE datetime2(0) Checked
FUEL_PROFIT_LOSS money Checked
FS1_DATE date Checked
FS2_DATE date Checked
FS3_DATE date Checked
FS4_DATE date Checked
FS5_DATE date Checked
FS6_DATE date Checked
FS7_DATE date Checked
FS8_DATE date Checked
FUEL_CARD_1 nvarchar(5) Checked
FUEL_CARD_2 nvarchar(5) Checked
FUEL_CARD_3 nvarchar(5) Checked
FUEL_CARD_4 nvarchar(5) Checked
FUEL_CARD_5 nvarchar(5) Checked
FUEL_CARD_6 nvarchar(5) Checked
FUEL_CARD_7 nvarchar(5) Checked
FUEL_CARD_8 nvarchar(5) Checked
FUEL_CARD_DISCOUNT_1 money Checked
FUEL_CARD_DISCOUNT_2 money Checked
FUEL_CARD_DISCOUNT_3 money Checked
FUEL_CARD_DISCOUNT_4 money Checked
FUEL_CARD_DISCOUNT_5 money Checked
FUEL_CARD_DISCOUNT_6 money Checked
FUEL_CARD_DISCOUNT_7 money Checked
FUEL_CARD_DISCOUNT_8 money Checked
FUEL_CARD_DISCNT_TOT money Checked
FUEL_CARD_FEE_1 nchar(3) Checked
FUEL_CARD_FEE_2 nchar(3) Checked
FUEL_CARD_FEE_3 nchar(3) Checked
FUEL_CARD_FEE_4 nchar(3) Checked
FUEL_CARD_FEE_5 nchar(3) Checked
FUEL_CARD_FEE_6 nchar(3) Checked
FUEL_CARD_FEE_7 nchar(3) Checked
FUEL_CARD_FEE_8 nchar(3) Checked
FUEL_CARD_FEE_TOTAL money Checked
FUEL_CARD_FEE_AMT_1 money Checked
FUEL_CARD_FEE_AMT_2 money Checked
FUEL_CARD_FEE_AMT_3 money Checked
FUEL_CARD_FEE_AMT_4 money Checked
FUEL_CARD_FEE_AMT_5 money Checked
FUEL_CARD_FEE_AMT_6 money Checked
FUEL_CARD_FEE_AMT_7 money Checked
FUEL_CARD_FEE_AMT_8 money Checked
FUEL_NOTES nvarchar(MAX) Checked
FUEL_SUR_PAID money Checked
FUEL_SUR_TRUCK money Checked
FUEL_SUR_ADJ_PAID money Checked
FUEL_SUR_ADJ_TRUCK money Checked
INTELLISET nvarchar(50) Checked
LINE_TOTAL_1 money Checked
LINE_TOTAL_2 money Checked
LINE_TOTAL_3 money Checked
LINE_TOTAL_4 money Checked
LINE_TOTAL_5 money Checked
LINE_TOTAL_6 money Checked
LINE_TOTAL_7 money Checked
LINE_TOTAL_8 money Checked
LINE_TOTAL_TOT money Checked
LOADED_DIFF int Checked
MILEAGE_S1 int Checked
MILEAGE_S2 int Checked
MILEAGE_S3 int Checked
MILEAGE_S4 int Checked
MILEAGE_S5 int Checked
MILEAGE_S6 int Checked
MILEAGE_S7 int Checked
MILEAGE_S8 int Checked
ODOMETER_END numeric(18, 0) Checked
ODOMETER_LAST_90 numeric(18, 0) Checked
ODOMETER_S1 numeric(18, 0) Checked
ODOMETER_S2 numeric(18, 0) Checked
ODOMETER_S3 numeric(18, 0) Checked
ODOMETER_S4 numeric(18, 0) Checked
ODOMETER_S5 numeric(18, 0) Checked
ODOMETER_S6 numeric(18, 0) Checked
ODOMETER_S7 numeric(18, 0) Checked
ODOMETER_S8 numeric(18, 0) Checked
ODOMETER_START numeric(18, 0) Checked
PETS_LOAD_NUMB nvarchar(10) Checked
PUMP_FUEL_TOTAL money Checked
PUMP_FUEL_TOT_1 money Checked
PUMP_FUEL_TOT_2 money Checked
PUMP_FUEL_TOT_3 money Checked
PUMP_FUEL_TOT_4 money Checked
PUMP_FUEL_TOT_5 money Checked
PUMP_FUEL_TOT_6 money Checked
PUMP_FUEL_TOT_7 money Checked
PUMP_FUEL_TOT_8 money Checked
RCVR_CITY_STATE nvarchar(255) Checked
RCVR_CODE nvarchar(10) Checked
REEFER_FUEL_PROFIT_LOSS money Checked
REEFER_HOURS int Checked
RFR_1ST_FUEL_1 nchar(3) Checked
RFR_1ST_FUEL_2 nchar(3) Checked
RFR_1ST_FUEL_3 nchar(3) Checked
RFR_ADJ_COST_1 money Checked
RFR_ADJ_COST_2 money Checked
RFR_ADJ_COST_3 money Checked
RFR_ADJ_COST_4 money Checked
RFR_ADJ_COST_5 money Checked
RFR_ADJ_COST_6 money Checked
RFR_ADJ_COST_7 money Checked
RFR_ADJ_COST_8 money Checked
RFR_ADJ_CPG_1 money Checked
RFR_ADJ_CPG_2 money Checked
RFR_ADJ_CPG_3 money Checked
RFR_ADJ_CPG_4 money Checked
RFR_ADJ_CPG_5 money Checked
RFR_ADJ_CPG_6 money Checked
RFR_ADJ_CPG_7 money Checked
RFR_ADJ_CPG_8 money Checked
RFR_ADJ_COST_TOT money Checked
RFR_ADJ_CPG_TOT money Checked
RFR_CARD_DISCOUNT_1 money Checked
RFR_CARD_DISCOUNT_2 money Checked
RFR_CARD_DISCOUNT_3 money Checked
RFR_CARD_DISCOUNT_4 money Checked
RFR_CARD_DISCOUNT_5 money Checked
RFR_CARD_DISCOUNT_6 money Checked
RFR_CARD_DISCOUNT_7 money Checked
RFR_CARD_DISCOUNT_8 money Checked
RFR_CARD_DISC_TOT money Checked
RFR_CARD_FEE_1 nchar(3) Checked
RFR_CARD_FEE_2 nchar(3) Checked
RFR_CARD_FEE_3 nchar(3) Checked
RFR_CARD_FEE_4 nchar(3) Checked
RFR_CARD_FEE_5 nchar(3) Checked
RFR_CARD_FEE_6 nchar(3) Checked
RFR_CARD_FEE_7 nchar(3) Checked
RFR_CARD_FEE_8 nchar(3) Checked
RFR_CPG_1 money Checked
RFR_CPG_2 money Checked
RFR_CPG_3 money Checked
RFR_CPG_4 money Checked
RFR_CPG_5 money Checked
RFR_CPG_6 money Checked
RFR_CPG_7 money Checked
RFR_CPG_8 money Checked
RFR_CPG_TOT money Checked
RFR_FEE_AMT_1 money Checked
RFR_FEE_AMT_2 money Checked
RFR_FEE_AMT_3 money Checked
RFR_FEE_AMT_4 money Checked
RFR_FEE_AMT_5 money Checked
RFR_FEE_AMT_6 money Checked
RFR_FEE_AMT_7 money Checked
RFR_FEE_AMT_8 money Checked
RFR_FEE_AMT_TOT money Checked
RFR_FUEL_COST_1 money Checked
RFR_FUEL_COST_2 money Checked
RFR_FUEL_COST_3 money Checked
RFR_FUEL_COST_4 money Checked
RFR_FUEL_COST_5 money Checked
RFR_FUEL_COST_6 money Checked
RFR_FUEL_COST_7 money Checked
RFR_FUEL_COST_8 money Checked
RFR_FUEL_COST_TOT money Checked
RFR_FUEL_SUR_PAID money Checked
RFR_FUEL_SUR_TRUCK money Checked
RFR_GALS_PURCH_1 decimal(7, 3) Checked
RFR_GALS_PURCH_2 decimal(7, 3) Checked
RFR_GALS_PURCH_3 decimal(7, 3) Checked
RFR_GALS_PURCH_4 decimal(7, 3) Checked
RFR_GALS_PURCH_5 decimal(7, 3) Checked
RFR_GALS_PURCH_6 decimal(7, 3) Checked
RFR_GALS_PURCH_7 decimal(7, 3) Checked
RFR_GALS_PURCH_8 decimal(7, 3) Checked
RFR_GALS_PURCH_TOT decimal(7, 3) Checked
RFR_PUMP_TOTAL money Checked
RFR_PUMP_TOT_1 money Checked
RFR_PUMP_TOT_2 money Checked
RFR_PUMP_TOT_3 money Checked
RFR_PUMP_TOT_4 money Checked
RFR_PUMP_TOT_5 money Checked
RFR_PUMP_TOT_6 money Checked
RFR_PUMP_TOT_7 money Checked
RFR_PUMP_TOT_8 money Checked
RFR_TAX_REFUND_1 money Checked
RFR_TAX_REFUND_2 money Checked
RFR_TAX_REFUND_3 money Checked
RFR_TAX_REFUND_4 money Checked
RFR_TAX_REFUND_5 money Checked
RFR_TAX_REFUND_6 money Checked
RFR_TAX_REFUND_7 money Checked
RFR_TAX_REFUND_8 money Checked
RFR_TAX_REFUND_TOT money Checked
SHIP_CITY_STATE nvarchar(255) Checked
SHIP_CODE nvarchar(10) Checked
STATE_1 nvarchar(5) Checked
STATE_2 nvarchar(5) Checked
STATE_3 nvarchar(5) Checked
STATE_4 nvarchar(5) Checked
STATE_5 nvarchar(5) Checked
STATE_6 nvarchar(5) Checked
STATE_7 nvarchar(5) Checked
STATE_8 nvarchar(5) Checked
STATE_TAX_1 money Checked
STATE_TAX_2 money Checked
STATE_TAX_3 money Checked
STATE_TAX_4 money Checked
STATE_TAX_5 money Checked
STATE_TAX_6 money Checked
STATE_TAX_7 money Checked
STATE_TAX_8 money Checked
TERMINAL_FUEL_1 nchar(3) Checked
TERMINAL_FUEL_2 nchar(3) Checked
TERMINAL_FUEL_3 nchar(3) Checked
TERMINAL_FUEL_4 nchar(3) Checked
TERMINAL_FUEL_5 nchar(3) Checked
TERMINAL_FUEL_6 nchar(3) Checked
TERMINAL_FUEL_7 nchar(3) Checked
TERMINAL_FUEL_8 nchar(3) Checked
TOT_CARD_FEES money Checked
TOT_CARDS_USED int Checked
TOT_COMBINED_DISC money Checked
TOT_COMBINED_GALS decimal(7, 3) Checked
TOT_DEF_CARDS_USED int Checked
TOT_RFR_CARDS_USED int Checked
TOT_TRK_CARDS_USED int Checked
TOT_MILE_DIFF int Checked
TOT_REIMBURSE int Checked
TOT_TERM_PURCHS int Checked
TOTAL_GALS_PURCH decimal(7, 3) Checked
TOTAL_LOAD_MILES numeric(10, 0) Checked
TOTAL_UNLADEN numeric(5, 0) Checked
TRAILER_HOOKED nvarchar(12) Checked
TRK_FUEL_COST_1 money Checked
TRK_FUEL_COST_2 money Checked
TRK_FUEL_COST_3 money Checked
TRK_FUEL_COST_4 money Checked
TRK_FUEL_COST_5 money Checked
TRK_FUEL_COST_6 money Checked
TRK_FUEL_COST_7 money Checked
TRK_FUEL_COST_8 money Checked
TRK_FUEL_COST_TOT money Checked
TRK_GALS_PURCH_1 decimal(7, 3) Checked
TRK_GALS_PURCH_2 decimal(7, 3) Checked
TRK_GALS_PURCH_3 decimal(7, 3) Checked
TRK_GALS_PURCH_4 decimal(7, 3) Checked
TRK_GALS_PURCH_5 decimal(7, 3) Checked
TRK_GALS_PURCH_6 decimal(7, 3) Checked
TRK_GALS_PURCH_7 decimal(7, 3) Checked
TRK_GALS_PURCH_8 decimal(7, 3) Checked
TRK_GALS_PURCH_TOT decimal(7, 3) Checked
TRIP_MPG decimal(5, 2) Checked
TRUCK_FUEL_PROFIT_LOSS money Checked
UL_ODOMETER_END int Checked
UL_STATE_1 nvarchar(5) Checked
UL_STATE_2 nvarchar(5) Checked
UL_STATE_3 nvarchar(5) Checked
UL_STATE_4 nvarchar(5) Checked
UL_STATE_5 nvarchar(5) Checked
UL_STATE_6 nvarchar(5) Checked
UL_STATE_7 nvarchar(5) Checked
UL_STATE_8 nvarchar(5) Checked
WEIGHT int Checked
Unchecked

1st provide the DDL for the sample table

create table #panda(ID int , ACTUAL_DH numeric(5, 0),
--and do this for all of the rest of the columns

not going to do this for you for all of the fields , every single one of those columns

are these columns mapping to actual state names?
STATE_1, STATE_2, STATE_3, STATE_4, STATE_5, STATE_6, STATE_7, STATE_8

sounds like you need unpivot. but still you need to provide sample data.
Who designed this?

I'm working on the table. The state names are not mapped, they are imported off the sheet used to input the information (they are abbreviations not full state names). I designed this.

create table #panda(ID int, DEF_GALS_1 decimal(7, 3),
DEF_GALS_2 decimal(7, 3),
DEF_GALS_3 decimal(7, 3),
DEF_GALS_4 decimal(7, 3),
DEF_GALS_5 decimal(7, 3),
DEF_GALS_6 decimal(7, 3),
DEF_GALS_7 decimal(7, 3),
DEF_GALS_8 decimal(7, 3),
DEF_COST_1 money,
DEF_COST_2 money,
DEF_COST_3 money,
DEF_COST_4 money,
DEF_COST_5 money,
DEF_COST_6 money,
DEF_COST_7 money,
DEF_COST_8 money,
RFR_GALS_PURCH_1 decimal(7, 3),
RFR_GALS_PURCH_2 decimal(7, 3),
RFR_GALS_PURCH_3 decimal(7, 3),
RFR_GALS_PURCH_4 decimal(7, 3),
RFR_GALS_PURCH_5 decimal(7, 3),
RFR_GALS_PURCH_6 decimal(7, 3),
RFR_GALS_PURCH_7 decimal(7, 3),
RFR_GALS_PURCH_8 decimal(7, 3),
RFR_FUEL_COST_1 money,
RFR_FUEL_COST_2 money,
RFR_FUEL_COST_3 money,
RFR_FUEL_COST_4 money,
RFR_FUEL_COST_5 money,
RFR_FUEL_COST_6 money,
RFR_FUEL_COST_7 money,
RFR_FUEL_COST_8 money,
TRK_GALS_PURCH_1 decimal(7, 3),
TRK_GALS_PURCH_2 decimal(7, 3),
TRK_GALS_PURCH_3 decimal(7, 3),
TRK_GALS_PURCH_4 decimal(7, 3),
TRK_GALS_PURCH_5 decimal(7, 3),
TRK_GALS_PURCH_6 decimal(7, 3),
TRK_GALS_PURCH_7 decimal(7, 3),
TRK_GALS_PURCH_8 decimal(7, 3),
TRK_FUEL_COST_1 money,
TRK_FUEL_COST_2 money,
TRK_FUEL_COST_3 money,
TRK_FUEL_COST_4 money,
TRK_FUEL_COST_5 money,
TRK_FUEL_COST_6 money,
TRK_FUEL_COST_7 money,
TRK_FUEL_COST_8 money,
STATE_1 nvarchar(5),
STATE_2 nvarchar(5),
STATE_3 nvarchar(5),
STATE_4 nvarchar(5),
STATE_5 nvarchar(5),
STATE_6 nvarchar(5),
STATE_7 nvarchar(5),
STATE_8 nvarchar(5))

I cannot attach any files except image files so I have no idea how to supply sample data from my DB. Can you assist in how to supply same? I pulled a sample pull from the live DB and created a csv file but I am not allowed to send it.

now that you have the table schema (DDL) you can provide the sample data as follows

insert into #panda
select '2020000', 'AR', null, 

--etc

until you have all of the data in the image.

not trying to be abrupt but some tough love

Are you wanting me to post the insert here as well? it'll be fairly lengthy? Tough love I'm OK with so long as it stays above degrading... I just really had no idea what you were referring to earlier.

yes post all of it. or as many as you can that can answer your question

Ok, entire thing all over - get ready ... set ... go!! LOL

I hope the insert will be ok the way I did it... it is the only way I know how.

create table #panda(ID int, STATE_1 nvarchar(5),
STATE_2 nvarchar(5),
STATE_3 nvarchar(5),
STATE_4 nvarchar(5),
STATE_5 nvarchar(5),
STATE_6 nvarchar(5),
STATE_7 nvarchar(5),
STATE_8 nvarchar(5),
TRK_FUEL_COST_1 money,
TRK_FUEL_COST_2 money,
TRK_FUEL_COST_3 money,
TRK_FUEL_COST_4 money,
TRK_FUEL_COST_5 money,
TRK_FUEL_COST_6 money,
TRK_FUEL_COST_7 money,
TRK_FUEL_COST_8 money,
TRK_GALS_PURCH_1 decimal(7, 3),
TRK_GALS_PURCH_2 decimal(7, 3),
TRK_GALS_PURCH_3 decimal(7, 3),
TRK_GALS_PURCH_4 decimal(7, 3),
TRK_GALS_PURCH_5 decimal(7, 3),
TRK_GALS_PURCH_6 decimal(7, 3),
TRK_GALS_PURCH_7 decimal(7, 3),
TRK_GALS_PURCH_8 decimal(7, 3),
RFR_FUEL_COST_1 money,
RFR_FUEL_COST_2 money,
RFR_FUEL_COST_3 money,
RFR_FUEL_COST_4 money,
RFR_FUEL_COST_5 money,
RFR_FUEL_COST_6 money,
RFR_FUEL_COST_7 money,
RFR_FUEL_COST_8 money,
RFR_GALS_PURCH_1 decimal(7, 3),
RFR_GALS_PURCH_2 decimal(7, 3),
RFR_GALS_PURCH_3 decimal(7, 3),
RFR_GALS_PURCH_4 decimal(7, 3),
RFR_GALS_PURCH_5 decimal(7, 3),
RFR_GALS_PURCH_6 decimal(7, 3),
RFR_GALS_PURCH_7 decimal(7, 3),
RFR_GALS_PURCH_8 decimal(7, 3),
DEF_COST_1 money,
DEF_COST_2 money,
DEF_COST_3 money,
DEF_COST_4 money,
DEF_COST_5 money,
DEF_COST_6 money,
DEF_COST_7 money,
DEF_COST_8 money,
DEF_GALS_1 decimal(7, 3),
DEF_GALS_2 decimal(7, 3),
DEF_GALS_3 decimal(7, 3),
DEF_GALS_4 decimal(7, 3),
DEF_GALS_5 decimal(7, 3),
DEF_GALS_6 decimal(7, 3),
DEF_GALS_7 decimal(7, 3),
DEF_GALS_8 decimal(7, 3))

INSERT INTO #panda (STATE_1, STATE_2, STATE_3, STATE_4, STATE_5, STATE_6, STATE_7, STATE_8,
TRK_FUEL_COST_1, TRK_FUEL_COST_2, TRK_FUEL_COST_3, TRK_FUEL_COST_4, TRK_FUEL_COST_5, TRK_FUEL_COST_6, TRK_FUEL_COST_7, TRK_FUEL_COST_8,
TRK_GALS_PURCH_1, TRK_GALS_PURCH_2, TRK_GALS_PURCH_3, TRK_GALS_PURCH_4, TRK_GALS_PURCH_5, TRK_GALS_PURCH_6, TRK_GALS_PURCH_7, TRK_GALS_PURCH_8,
RFR_FUEL_COST_1, RFR_FUEL_COST_2, RFR_FUEL_COST_3, RFR_FUEL_COST_4, RFR_FUEL_COST_5, RFR_FUEL_COST_6, RFR_FUEL_COST_7, RFR_FUEL_COST_8,
RFR_GALS_PURCH_1, RFR_GALS_PURCH_2, RFR_GALS_PURCH_3, RFR_GALS_PURCH_4, RFR_GALS_PURCH_5, RFR_GALS_PURCH_6, RFR_GALS_PURCH_7, RFR_GALS_PURCH_8,
DEF_COST_1, DEF_COST_2, DEF_COST_3, DEF_COST_4, DEF_COST_5, DEF_COST_6, DEF_COST_7, DEF_COST_8,
DEF_GALS_2, DEF_GALS_3, DEF_GALS_4, DEF_GALS_5, DEF_GALS_6, DEF_GALS_7, DEF_GALS_8)
VALUES ('AL','----','----','----','----','----','----','----','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.00','114.001','0.000','0.000','0.000','0.000','0.000','0.000','0.000','315.67','0.00','0.00','0.00','0.00','0.00','0.00','0.00'),
('----','----','----','----','----','----','----','----','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.00'),
('MO','OH','----','----','----','----','----','----','0.00','27.88','0.00','0.00','0.00','0.00','0.00','0.00','0.000','10.404','0.000','0.000','0.000','0.000','0.000','0.000','9.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','24.02','0.00','0.00','0.00','0.00','0.00','0.00','0.00','153.001','124.001','0.000','0.000','0.000','0.000','0.000','0.000','408.36','351.06','0.00','0.00','0.00','0.00','0.00','0.00'),
('FL','TX','AZ','----','----','----','----','----','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','13.007','9.007','8.001','0.000','0.000','0.000','0.000','0.000','28.60','20.78','20.02','0.00','0.00','0.00','0.00','0.00','109.001','144.001','108.005','0.000','0.000','0.000','0.000','0.000','274.97','332.14','270.30','0.00','0.00','0.00','0.00','0.00'),
('AZ','NV','NV','----','----','----','----','----','44.39','0.00','0.00','0.00','0.00','0.00','0.00','0.00','15.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','10.000','5.012','21.001','0.000','0.000','0.000','0.000','0.000','28.69','13.31','62.35','0.00','0.00','0.00','0.00','0.00','41.001','104.000','56.001','0.000','0.000','0.000','0.000','0.000','117.63','276.22','166.27','0.00','0.00','0.00','0.00','0.00'),
('WA','MT','WY','----','----','----','----','----','0.00','32.00','0.00','0.00','0.00','0.00','0.00','0.00','0.000','11.154','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.00','145.001','68.000','104.000','0.000','0.000','0.000','0.000','0.000','474.01','159.73','245.59','0.00','0.00','0.00','0.00','0.00'),
('----','----','----','----','----','----','----','----','35.66','0.00','0.00','0.00','0.00','0.00','0.00','0.00','11.890','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.00','98.001','0.000','0.000','0.000','0.000','0.000','0.000','0.000','235.10','0.00','0.00','0.00','0.00','0.00','0.00','0.00'),
('----','----','----','----','----','----','----','----','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.00'),
('----','----','----','----','----','----','----','----','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.00'),
('MO','----','----','----','----','----','----','----','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','10.842','0.000','0.000','0.000','0.000','0.000','0.000','0.000','22.43','0.00','0.00','0.00','0.00','0.00','0.00','0.00','96.024','0.000','0.000','0.000','0.000','0.000','0.000','0.000','198.66','0.00','0.00','0.00','0.00','0.00','0.00','0.00'),
('TN','TN','----','----','----','----','----','----','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','7.003','0.000','0.000','0.000','0.000','0.000','0.000','0.000','15.04','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.000','202.830','0.000','0.000','0.000','0.000','0.000','0.000','0.00','202.83','0.00','0.00','0.00','0.00','0.00','0.00'),
('TN','----','----','----','----','----','----','----','34.00','0.00','0.00','0.00','0.00','0.00','0.00','0.00','11.336','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.00','128.002','0.000','0.000','0.000','0.000','0.000','0.000','0.000','266.12','0.00','0.00','0.00','0.00','0.00','0.00','0.00'),
('----','----','----','----','----','----','----','----','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.00'),
('----','----','----','----','----','----','----','----','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.00'),
('NC','----','----','----','----','----','----','----','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.00','60.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','133.14','0.00','0.00','0.00','0.00','0.00','0.00','0.00'),
('----','----','----','----','----','----','----','----','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.00'),
('NC','----','----','----','----','----','----','----','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.00','75.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','166.43','0.00','0.00','0.00','0.00','0.00','0.00','0.00'),
('----','----','----','----','----','----','----','----','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.00'),
('TN','----','----','----','----','----','----','----','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','11.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','20.34','0.00','0.00','0.00','0.00','0.00','0.00','0.00','107.002','0.000','0.000','0.000','0.000','0.000','0.000','0.000','197.84','0.00','0.00','0.00','0.00','0.00','0.00','0.00'),
('IL','----','----','----','----','----','----','----','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','7.002','0.000','0.000','0.000','0.000','0.000','0.000','0.000','14.84','0.00','0.00','0.00','0.00','0.00','0.00','0.00','90.001','0.000','0.000','0.000','0.000','0.000','0.000','0.000','190.71','0.00','0.00','0.00','0.00','0.00','0.00','0.00'),
('GA','----','----','----','----','----','----','----','32.99','0.00','0.00','0.00','0.00','0.00','0.00','0.00','11.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','18.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','33.82','0.00','0.00','0.00','0.00','0.00','0.00','0.00','128.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','240.51','0.00','0.00','0.00','0.00','0.00','0.00','0.00'),
('----','----','----','----','----','----','----','----','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.00'),
('MS','KY','----','----','----','----','----','----','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.00','59.427','105.016','0.000','0.000','0.000','0.000','0.000','0.000','97.83','193.76','0.00','0.00','0.00','0.00','0.00','0.00'),
('----','----','----','----','----','----','----','----','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.00'),
('OH','----','----','----','----','----','----','----','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','10.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','19.79','0.00','0.00','0.00','0.00','0.00','0.00','0.00','91.004','0.000','0.000','0.000','0.000','0.000','0.000','0.000','180.10','0.00','0.00','0.00','0.00','0.00','0.00','0.00'),
('KY','AL','LA','----','----','----','----','----','0.00','0.00','30.00','0.00','0.00','0.00','0.00','0.00','0.000','0.000','10.003','0.000','0.000','0.000','0.000','0.000','11.002','0.000','13.021','0.000','0.000','0.000','0.000','0.000','26.29','0.00','29.94','0.00','0.00','0.00','0.00','0.00','0.000','107.001','62.000','0.000','0.000','0.000','0.000','0.000','0.00','211.76','125.18','0.00','0.00','0.00','0.00','0.00'),
('MO','----','----','----','----','----','----','----','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.00','132.071','0.000','0.000','0.000','0.000','0.000','0.000','0.000','226.28','0.00','0.00','0.00','0.00','0.00','0.00','0.00'),
('IL','----','----','----','----','----','----','----','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.00','90.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','190.71','0.00','0.00','0.00','0.00','0.00','0.00','0.00'),
('TN','----','----','----','----','----','----','----','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.00','140.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','246.26','0.00','0.00','0.00','0.00','0.00','0.00','0.00'),
('TN','----','----','----','----','----','----','----','37.49','0.00','0.00','0.00','0.00','0.00','0.00','0.00','12.500','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.00','120.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','209.88','0.00','0.00','0.00','0.00','0.00','0.00','0.00'),
('KY','----','----','----','----','----','----','----','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.00','80.002','0.000','0.000','0.000','0.000','0.000','0.000','0.000','158.32','0.00','0.00','0.00','0.00','0.00','0.00','0.00'),
('WI','----','----','----','----','----','----','----','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.00','108.999','0.000','0.000','0.000','0.000','0.000','0.000','0.000','214.75','0.00','0.00','0.00','0.00','0.00','0.00','0.00'),
('MS','----','----','----','----','----','----','----','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.00','139.400','0.000','0.000','0.000','0.000','0.000','0.000','0.000','254.32','0.00','0.00','0.00','0.00','0.00','0.00','0.00'),
('----','----','----','----','----','----','----','----','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.00'),
('KY','----','----','----','----','----','----','----','32.00','0.00','0.00','0.00','0.00','0.00','0.00','0.00','10.669','0.000','0.000','0.000','0.000','0.000','0.000','0.000','7.001','0.000','0.000','0.000','0.000','0.000','0.000','0.000','14.14','0.00','0.00','0.00','0.00','0.00','0.00','0.00','113.010','0.000','0.000','0.000','0.000','0.000','0.000','0.000','228.15','0.00','0.00','0.00','0.00','0.00','0.00','0.00'),
('----','----','----','----','----','----','----','----','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.00'),
('KY','NC','NC','NC','KY','KY','KY','----','0.00','0.00','30.00','0.00','0.00','0.00','0.00','0.00','0.000','0.000','10.071','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.00','107.004','141.996','0.000','127.001','95.006','20.010','143.004','0.000','209.62','285.28','0.00','255.14','182.32','42.40','274.43','0.00'),
('KY','NC','VA','TN','OH','----','----','----','34.79','0.00','0.00','0.00','0.00','0.00','0.00','0.00','11.600','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.00','87.003','146.002','30.001','143.001','149.000','0.000','0.000','0.000','189.58','307.91','68.07','303.02','342.55','0.00','0.00','0.00'),
('MO','----','----','----','----','----','----','----','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.00','131.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','249.49','0.00','0.00','0.00','0.00','0.00','0.00','0.00'),
('MO','----','----','----','----','----','----','----','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.00','143.001','0.000','0.000','0.000','0.000','0.000','0.000','0.000','272.99','0.00','0.00','0.00','0.00','0.00','0.00','0.00'),
('----','----','----','----','----','----','----','----','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.00'),
('MO','SD','MT','MT','----','----','----','----','0.00','0.00','42.00','0.00','0.00','0.00','0.00','0.00','0.000','0.000','14.639','0.000','0.000','0.000','0.000','0.000','18.001','0.000','0.000','8.018','0.000','0.000','0.000','0.000','36.52','0.00','0.00','15.14','0.00','0.00','0.00','0.00','41.000','146.003','138.001','52.012','0.000','0.000','0.000','0.000','85.10','287.58','271.72','98.25','0.00','0.00','0.00','0.00'),
('WA','MT','SD','TN','----','----','----','----','0.00','0.00','0.00','46.00','0.00','0.00','0.00','0.00','0.000','0.000','0.000','15.440','0.000','0.000','0.000','0.000','0.000','11.005','8.002','0.000','0.000','0.000','0.000','0.000','0.00','20.79','13.72','0.00','0.00','0.00','0.00','0.00','35.005','130.001','102.008','0.000','0.000','0.000','0.000','0.000','89.93','245.57','195.75','0.00','0.00','0.00','0.00','0.00'),
('TN','OH','VA','SC','KY','OH','TN','----','0.00','0.00','0.00','0.00','30.00','0.00','0.00','0.00','0.000','0.000','0.000','0.000','10.003','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.00','106.865','79.005','112.005','97.000','101.002','55.007','109.002','0.000','205.08','175.31','232.86','186.14','189.78','122.06','209.18','0.00'),
('NY','SC','SC','KY','KY','----','----','----','0.00','0.00','35.99','0.00','0.00','0.00','0.00','0.00','0.000','0.000','12.001','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.00','118.000','107.015','75.000','100.000','146.704','0.000','0.000','0.000','242.64','211.79','148.43','191.90','281.52','0.00','0.00','0.00');

read set----no go.

test locally before posting.

AH... OK... let me see what I cobbed up....

Missed a column

create table #panda (STATE_1 nvarchar(5),
STATE_2 nvarchar(5),
STATE_3 nvarchar(5),
STATE_4 nvarchar(5),
STATE_5 nvarchar(5),
STATE_6 nvarchar(5),
STATE_7 nvarchar(5),
STATE_8 nvarchar(5),
TRK_FUEL_COST_1 money,
TRK_FUEL_COST_2 money,
TRK_FUEL_COST_3 money,
TRK_FUEL_COST_4 money,
TRK_FUEL_COST_5 money,
TRK_FUEL_COST_6 money,
TRK_FUEL_COST_7 money,
TRK_FUEL_COST_8 money,
TRK_GALS_PURCH_1 decimal(7, 3),
TRK_GALS_PURCH_2 decimal(7, 3),
TRK_GALS_PURCH_3 decimal(7, 3),
TRK_GALS_PURCH_4 decimal(7, 3),
TRK_GALS_PURCH_5 decimal(7, 3),
TRK_GALS_PURCH_6 decimal(7, 3),
TRK_GALS_PURCH_7 decimal(7, 3),
TRK_GALS_PURCH_8 decimal(7, 3),
RFR_FUEL_COST_1 money,
RFR_FUEL_COST_2 money,
RFR_FUEL_COST_3 money,
RFR_FUEL_COST_4 money,
RFR_FUEL_COST_5 money,
RFR_FUEL_COST_6 money,
RFR_FUEL_COST_7 money,
RFR_FUEL_COST_8 money,
RFR_GALS_PURCH_1 decimal(7, 3),
RFR_GALS_PURCH_2 decimal(7, 3),
RFR_GALS_PURCH_3 decimal(7, 3),
RFR_GALS_PURCH_4 decimal(7, 3),
RFR_GALS_PURCH_5 decimal(7, 3),
RFR_GALS_PURCH_6 decimal(7, 3),
RFR_GALS_PURCH_7 decimal(7, 3),
RFR_GALS_PURCH_8 decimal(7, 3),
DEF_COST_1 money,
DEF_COST_2 money,
DEF_COST_3 money,
DEF_COST_4 money,
DEF_COST_5 money,
DEF_COST_6 money,
DEF_COST_7 money,
DEF_COST_8 money,
DEF_GALS_1 decimal(7, 3),
DEF_GALS_2 decimal(7, 3),
DEF_GALS_3 decimal(7, 3),
DEF_GALS_4 decimal(7, 3),
DEF_GALS_5 decimal(7, 3),
DEF_GALS_6 decimal(7, 3),
DEF_GALS_7 decimal(7, 3),
DEF_GALS_8 decimal(7, 3))

INSERT INTO #panda (STATE_1, STATE_2, STATE_3, STATE_4, STATE_5, STATE_6, STATE_7, STATE_8,
TRK_FUEL_COST_1, TRK_FUEL_COST_2, TRK_FUEL_COST_3, TRK_FUEL_COST_4, TRK_FUEL_COST_5, TRK_FUEL_COST_6, TRK_FUEL_COST_7, TRK_FUEL_COST_8,
TRK_GALS_PURCH_1, TRK_GALS_PURCH_2, TRK_GALS_PURCH_3, TRK_GALS_PURCH_4, TRK_GALS_PURCH_5, TRK_GALS_PURCH_6, TRK_GALS_PURCH_7, TRK_GALS_PURCH_8,
RFR_FUEL_COST_1, RFR_FUEL_COST_2, RFR_FUEL_COST_3, RFR_FUEL_COST_4, RFR_FUEL_COST_5, RFR_FUEL_COST_6, RFR_FUEL_COST_7, RFR_FUEL_COST_8,
RFR_GALS_PURCH_1, RFR_GALS_PURCH_2, RFR_GALS_PURCH_3, RFR_GALS_PURCH_4, RFR_GALS_PURCH_5, RFR_GALS_PURCH_6, RFR_GALS_PURCH_7, RFR_GALS_PURCH_8,
DEF_COST_1, DEF_COST_2, DEF_COST_3, DEF_COST_4, DEF_COST_5, DEF_COST_6, DEF_COST_7, DEF_COST_8,
DEF_GALS_1, DEF_GALS_2, DEF_GALS_3, DEF_GALS_4, DEF_GALS_5, DEF_GALS_6, DEF_GALS_7, DEF_GALS_8)
VALUES ('AL','----','----','----','----','----','----','----','315.67','0.00','0.00','0.00','0.00','0.00','0.00','0.00','114.001','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000'),
('----','----','----','----','----','----','----','----','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000'),
('MO','OH','----','----','----','----','----','----','408.36','351.06','0.00','0.00','0.00','0.00','0.00','0.00','153.001','124.001','0.000','0.000','0.000','0.000','0.000','0.000','24.02','0.00','0.00','0.00','0.00','0.00','0.00','0.00','9.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.00','27.88','0.00','0.00','0.00','0.00','0.00','0.00','0.000','10.404','0.000','0.000','0.000','0.000','0.000','0.000'),
('FL','TX','AZ','----','----','----','----','----','274.97','332.14','270.30','0.00','0.00','0.00','0.00','0.00','109.001','144.001','108.005','0.000','0.000','0.000','0.000','0.000','28.60','20.78','20.02','0.00','0.00','0.00','0.00','0.00','13.007','9.007','8.001','0.000','0.000','0.000','0.000','0.000','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000'),
('AZ','NV','NV','----','----','----','----','----','117.63','276.22','166.27','0.00','0.00','0.00','0.00','0.00','41.001','104.000','56.001','0.000','0.000','0.000','0.000','0.000','28.69','13.31','62.35','0.00','0.00','0.00','0.00','0.00','10.000','5.012','21.001','0.000','0.000','0.000','0.000','0.000','44.39','0.00','0.00','0.00','0.00','0.00','0.00','0.00','15.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000'),
('WA','MT','WY','----','----','----','----','----','474.01','159.73','245.59','0.00','0.00','0.00','0.00','0.00','145.001','68.000','104.000','0.000','0.000','0.000','0.000','0.000','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.00','32.00','0.00','0.00','0.00','0.00','0.00','0.00','0.000','11.154','0.000','0.000','0.000','0.000','0.000','0.000'),
('----','----','----','----','----','----','----','----','235.10','0.00','0.00','0.00','0.00','0.00','0.00','0.00','98.001','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','35.66','0.00','0.00','0.00','0.00','0.00','0.00','0.00','11.890','0.000','0.000','0.000','0.000','0.000','0.000','0.000'),
('----','----','----','----','----','----','----','----','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000'),
('----','----','----','----','----','----','----','----','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000'),
('MO','----','----','----','----','----','----','----','198.66','0.00','0.00','0.00','0.00','0.00','0.00','0.00','96.024','0.000','0.000','0.000','0.000','0.000','0.000','0.000','22.43','0.00','0.00','0.00','0.00','0.00','0.00','0.00','10.842','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000'),
('TN','TN','----','----','----','----','----','----','0.00','202.83','0.00','0.00','0.00','0.00','0.00','0.00','0.000','202.830','0.000','0.000','0.000','0.000','0.000','0.000','15.04','0.00','0.00','0.00','0.00','0.00','0.00','0.00','7.003','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000'),
('TN','----','----','----','----','----','----','----','266.12','0.00','0.00','0.00','0.00','0.00','0.00','0.00','128.002','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','34.00','0.00','0.00','0.00','0.00','0.00','0.00','0.00','11.336','0.000','0.000','0.000','0.000','0.000','0.000','0.000'),
('----','----','----','----','----','----','----','----','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000'),
('----','----','----','----','----','----','----','----','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000'),
('NC','----','----','----','----','----','----','----','133.14','0.00','0.00','0.00','0.00','0.00','0.00','0.00','60.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000'),
('----','----','----','----','----','----','----','----','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000'),
('NC','----','----','----','----','----','----','----','166.43','0.00','0.00','0.00','0.00','0.00','0.00','0.00','75.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000'),
('----','----','----','----','----','----','----','----','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000'),
('TN','----','----','----','----','----','----','----','197.84','0.00','0.00','0.00','0.00','0.00','0.00','0.00','107.002','0.000','0.000','0.000','0.000','0.000','0.000','0.000','20.34','0.00','0.00','0.00','0.00','0.00','0.00','0.00','11.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000'),
('IL','----','----','----','----','----','----','----','190.71','0.00','0.00','0.00','0.00','0.00','0.00','0.00','90.001','0.000','0.000','0.000','0.000','0.000','0.000','0.000','14.84','0.00','0.00','0.00','0.00','0.00','0.00','0.00','7.002','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000'),
('GA','----','----','----','----','----','----','----','240.51','0.00','0.00','0.00','0.00','0.00','0.00','0.00','128.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','33.82','0.00','0.00','0.00','0.00','0.00','0.00','0.00','18.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','32.99','0.00','0.00','0.00','0.00','0.00','0.00','0.00','11.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000'),
('----','----','----','----','----','----','----','----','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000'),
('MS','KY','----','----','----','----','----','----','97.83','193.76','0.00','0.00','0.00','0.00','0.00','0.00','59.427','105.016','0.000','0.000','0.000','0.000','0.000','0.000','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000'),
('----','----','----','----','----','----','----','----','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000'),
('OH','----','----','----','----','----','----','----','180.10','0.00','0.00','0.00','0.00','0.00','0.00','0.00','91.004','0.000','0.000','0.000','0.000','0.000','0.000','0.000','19.79','0.00','0.00','0.00','0.00','0.00','0.00','0.00','10.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000'),
('KY','AL','LA','----','----','----','----','----','0.00','211.76','125.18','0.00','0.00','0.00','0.00','0.00','0.000','107.001','62.000','0.000','0.000','0.000','0.000','0.000','26.29','0.00','29.94','0.00','0.00','0.00','0.00','0.00','11.002','0.000','13.021','0.000','0.000','0.000','0.000','0.000','0.00','0.00','30.00','0.00','0.00','0.00','0.00','0.00','0.000','0.000','10.003','0.000','0.000','0.000','0.000','0.000'),
('MO','----','----','----','----','----','----','----','226.28','0.00','0.00','0.00','0.00','0.00','0.00','0.00','132.071','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000'),
('IL','----','----','----','----','----','----','----','190.71','0.00','0.00','0.00','0.00','0.00','0.00','0.00','90.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000'),
('TN','----','----','----','----','----','----','----','246.26','0.00','0.00','0.00','0.00','0.00','0.00','0.00','140.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000'),
('TN','----','----','----','----','----','----','----','209.88','0.00','0.00','0.00','0.00','0.00','0.00','0.00','120.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','37.49','0.00','0.00','0.00','0.00','0.00','0.00','0.00','12.500','0.000','0.000','0.000','0.000','0.000','0.000','0.000'),
('KY','----','----','----','----','----','----','----','158.32','0.00','0.00','0.00','0.00','0.00','0.00','0.00','80.002','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000'),
('WI','----','----','----','----','----','----','----','214.75','0.00','0.00','0.00','0.00','0.00','0.00','0.00','108.999','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000'),
('MS','----','----','----','----','----','----','----','254.32','0.00','0.00','0.00','0.00','0.00','0.00','0.00','139.400','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000'),
('----','----','----','----','----','----','----','----','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000'),
('KY','----','----','----','----','----','----','----','228.15','0.00','0.00','0.00','0.00','0.00','0.00','0.00','113.010','0.000','0.000','0.000','0.000','0.000','0.000','0.000','14.14','0.00','0.00','0.00','0.00','0.00','0.00','0.00','7.001','0.000','0.000','0.000','0.000','0.000','0.000','0.000','32.00','0.00','0.00','0.00','0.00','0.00','0.00','0.00','10.669','0.000','0.000','0.000','0.000','0.000','0.000','0.000'),
('----','----','----','----','----','----','----','----','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000'),
('KY','NC','NC','NC','KY','KY','KY','----','209.62','285.28','0.00','255.14','182.32','42.40','274.43','0.00','107.004','141.996','0.000','127.001','95.006','20.010','143.004','0.000','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.00','0.00','30.00','0.00','0.00','0.00','0.00','0.00','0.000','0.000','10.071','0.000','0.000','0.000','0.000','0.000'),
('KY','NC','VA','TN','OH','----','----','----','189.58','307.91','68.07','303.02','342.55','0.00','0.00','0.00','87.003','146.002','30.001','143.001','149.000','0.000','0.000','0.000','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','34.79','0.00','0.00','0.00','0.00','0.00','0.00','0.00','11.600','0.000','0.000','0.000','0.000','0.000','0.000','0.000'),
('MO','----','----','----','----','----','----','----','249.49','0.00','0.00','0.00','0.00','0.00','0.00','0.00','131.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000'),
('MO','----','----','----','----','----','----','----','272.99','0.00','0.00','0.00','0.00','0.00','0.00','0.00','143.001','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000'),
('----','----','----','----','----','----','----','----','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000'),
('MO','SD','MT','MT','----','----','----','----','85.10','287.58','271.72','98.25','0.00','0.00','0.00','0.00','41.000','146.003','138.001','52.012','0.000','0.000','0.000','0.000','36.52','0.00','0.00','15.14','0.00','0.00','0.00','0.00','18.001','0.000','0.000','8.018','0.000','0.000','0.000','0.000','0.00','0.00','42.00','0.00','0.00','0.00','0.00','0.00','0.000','0.000','14.639','0.000','0.000','0.000','0.000','0.000'),
('WA','MT','SD','TN','----','----','----','----','89.93','245.57','195.75','0.00','0.00','0.00','0.00','0.00','35.005','130.001','102.008','0.000','0.000','0.000','0.000','0.000','0.00','20.79','13.72','0.00','0.00','0.00','0.00','0.00','0.000','11.005','8.002','0.000','0.000','0.000','0.000','0.000','0.00','0.00','0.00','46.00','0.00','0.00','0.00','0.00','0.000','0.000','0.000','15.440','0.000','0.000','0.000','0.000'),
('TN','OH','VA','SC','KY','OH','TN','----','205.08','175.31','232.86','186.14','189.78','122.06','209.18','0.00','106.865','79.005','112.005','97.000','101.002','55.007','109.002','0.000','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.00','0.00','0.00','0.00','30.00','0.00','0.00','0.00','0.000','0.000','0.000','0.000','10.003','0.000','0.000','0.000'),
('NY','SC','SC','KY','KY','----','----','----','242.64','211.79','148.43','191.90','281.52','0.00','0.00','0.00','118.000','107.015','75.000','100.000','146.704','0.000','0.000','0.000','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.00','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.000','0.00','0.00','35.99','0.00','0.00','0.00','0.00','0.00','0.000','0.000','12.001','0.000','0.000','0.000','0.000','0.000')

cool. question for you, what if tomorrow you are asked to track all US States, what will your current table design look like. or you go global and your application covers planet Earth and then Elon Musk asks you to be the go to guy for fueling all SpaceX spacecraft
launches for a few planets on a monthly cycle?

Why is AL $341.89?