I need to put columns in rows only for the last columns of my query's results.
The query is :
select
dpp.CODE_PORTEFEUILLE,
dpr.SOCIETE_GESTION,
lgp.CODE_GERANT,
lgp.DEVISE_GERANT,
lgp.CODE_INTERVENANT
from
GP3DBA.DESCRIPTIF_PORTEFEUILLE dpp
join GP3DBA.DESCRIPTIF_PORT_REPORTING dpr on dpp.CODE_PORTEFEUILLE = dpr.CODE_PORTEFEUILLE
join GP3DBA.LIEN_GERANT_PORTEFEUILLE lgp on dpp.CODE_PORTEFEUILLE = lgp.CODE_PORTEFEUILLE
I have tried to do it myself, but without any satisfying result.
EDIT
I don't see an easy way to do this. You actual result is in #tmpResult in this example.
then you just have to inject data in this table
Didn't try it, I have no actual case at reach but I know the logic works. But you should avoid doing this... It runs fairly slowly