Skip to content
Advertisement

oracle sql question on aggregation of transaction data

I am trying to add everything in te data (dollar_value_us, QUANTITY) but not add shipping total since each transaction number has multiple items but the customer only paid shipping once. I am using the below data:

https://dbfiddle.uk/?rdbms=oracle_11.2&fiddle=01693db7ce05b062804cedeb3b3a7e73

below is the query which I am using on my actual databse:

the final output for usa should have shipping total amount of 35

Advertisement

Answer

Try this:

Test Result:

DB<>Fiddle

User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement