AnsweredAssumed Answered

SQL/ NSQL Question

Question asked by juan.segovia on Feb 21, 2013
Latest reply on Feb 28, 2013 by Dave
Hi, I 'm currently working with a NSQL portlet using the following query:

[color=#ff0000]SELECT
@SELECT:DIM:USER_DEF:IMPLIED:LKP:ROW_NUMBER() over (order by lookup.NAME):CODIGO@,
@SELECT:DIM_PROP:USER_DEF:IMPLIED:LKP:lookup.name:lkp_nombre@,
@SELECT:DIM_PROP:USER_DEF:IMPLIED:LKP:osde_frente:osde_frente@,
@SELECT:DIM_PROP:USER_DEF:IMPLIED:LKP:count(*):Cantidad:agg@,
@SELECT:DIM_PROP:USER_DEF:IMPLIED:LKP:OSDE_INCLU_PLAN:OSDE_INCLU_PLAN@
from niku.INV_INVESTMENTS inv
inner join niku.ODF_CA_INV ca on inv.ID=ca.ID
inner join niku.ODF_CA_PROJECT proj on inv.ID=proj.ID
inner join niku.CMN_LOOKUPS_V lookup on osde_frente=LOOKUP_CODE
where inv.IS_ACTIVE=1
and lookup.LOOKUP_TYPE= 'OSDE_FRENTES' and lookup.LANGUAGE_CODE='es'
and inv.id!=5011001
and inv.id!=5012002
and ca.osde_rankeable=1
and osde_plan_semestral=(select plan_admin.osde_plan_actual from niku.ODF_CA_OSDE_PLAN_ADMIN plan_admin where plan_admin.id=5000000)
and @FILTER@
group by osde_frente, lookup.NAME, OSDE_INCLU_PLAN
having @HAVING_FILTER@[color]


The only problem I have here is that I need to also get the lookup name on my osde_inclu_plan attribute and I'm only getting the value on the DB.

Can anyone please help me to modify this query so I can also get the lookup name on my osde_inclu_plan attribute?

Thanks,

Juan

Outcomes