The query results of the Postgresql database return 6 columns, with the first column being the grouping column, the second column being the Value column within the group, and columns 3-6 being the Key ...
inner join t_NA_PurchaseDetails b with(NOLOCK) on a.f_PurchaseCode = b.f_PurchaseCode inner join t_NA_CustomerDetails c with(NOLOCK) on c.f_CustomerCode = b.f ...