I'm currently working on APEX where I expect the following query to work.. But its not working or giving me any errors.
here is the query
select et.equipment_type,
max(case when name='Managed_Ip' then value end) as SNMP_port,
e.equipment_name as equipment_name,
cu.customer_name as customer_name,
st.site_name as site_name
from equipment_feature ef inner join equipments e on(e.equipment_id=ef.equipment_id) inner
join equipment_types et on (e.equipment_type_id=et.equipment_type_id)
inner join customers cu on(ef.name='customer_id'and ef.value=cu.customer_id)
inner join site st on(ef.name='site_id' and ef.value=st.site_id)
group by et.equipment_type,e.equipment_name,cu.customer_name,st.site_name
At the same time if I comment some lines the query fetches the result.
select et.equipment_type,
max(case when name='Managed_Ip' then value end) as SNMP_port,
e.equipment_name as equipment_name,
--cu.customer_name as customer_name,
--st.site_name as site_name
from equipment_feature ef inner join equipments e on(e.equipment_id=ef.equipment_id) inner
join equipment_types et on (e.equipment_type_id=et.equipment_type_id)
--inner join customers cu on(ef.name='customer_id' and ef.value=cu.customer_id)
--inner join site st on(ef.name='site_id' and ef.value=st.site_id)
group by et.equipment_type,e.equipment_name
--,cu.customer_name,st.site_name
Any help would be really appreciated.