ost ocity dst dcity shipdate paid amt transport amt
A B C D 1/1/07 7888 777
E F G H 2/3/07 733 887
I J K L 4/5/08 998 756
A B M N 5/1/08 778 697
E F S T 9/1/08 877 345
A B O Q 1/2/07 20 10
OUTPUT required is
ost ocity sumoftransportamt(2007) sumoftransportamt(2008)
sumoftransportamt(2007) sumofpaidamt(2007) sumofpaidamt(08)
A B 787 697
697 7908 778
E F
887
345 877 733
i want to calculate the sum of paid amt and transport amt for every
origin(ost and ocity) and then compare the totals across two years 07
and 08.
can this be done using a single query- SQL ? what would be a single
SQL statement?
thanks
A B C D 1/1/07 7888 777
E F G H 2/3/07 733 887
I J K L 4/5/08 998 756
A B M N 5/1/08 778 697
E F S T 9/1/08 877 345
A B O Q 1/2/07 20 10
OUTPUT required is
ost ocity sumoftransportamt(2007) sumoftransportamt(2008)
sumoftransportamt(2007) sumofpaidamt(2007) sumofpaidamt(08)
A B 787 697
697 7908 778
E F
887
345 877 733
i want to calculate the sum of paid amt and transport amt for every
origin(ost and ocity) and then compare the totals across two years 07
and 08.
can this be done using a single query- SQL ? what would be a single
SQL statement?
thanks