I need your help again for the following. Please note that I am using SQL SERVER 2008. I have a table (below) where we got Number of jobs done from the "Pickup" to the "Dropoff". The requirements are (output format mentioned below). 1) Get all the unique postcodes regardless of them being dropoffs or pickups. This will give us all the postcodes. 2) Present the count of jobs done from PICKUP to the corresponding DROPOFF. For example, we pick passengers up from SE18 postcode twice and took them to SE18 once and SE19 once. It will be cleared from the REQUIRED OUTPUT table.
TABLE:
JobID Pickup Dropoff
====================================
1 SE18 SE18
2 SE18 SE19
3 SE2 SE18
4 SE28 SE2
5 AL1 SE7
6 BR1 SE10
7 NW1 TW16
8 AL1 SE18
9 BR6 AL1
10 E6 BR1
. . .
. . .
. . .
The require output is as the following:
REQUIRED OUTPUT
SE18 SE2 SE28 AL1 BR1 NW1 BR6 E6 SE19 SE7 SE10 TW16 ..
=========================================================================
SE18 1 - - - - - - - 1 0 0 0
SE2 1 - - - - - - - - - - -
SE28 - 1 - - - - - - - - - -
AL1 1 - - - - - - - - 1 - -
BR1 - - - - - - - - - - 1 -
NW1 - - - - - - - - - - - 1
BR6 - - - 1 - - - - - - - -
E6 - - - - 1 - - - - - - -
SE19 - - - - - - - - - - - -
SE7 - - - - - - - - - - - -
SE10 - - - - - - - - - - - -
TW16 - - - - - - - - - - - -
.
.
.
Many thanks in advance. Kind regards