Skip to Content
1
Jun 26, 2015 at 07:12 AM

subselect in flexible search query

4497 Views

select * from ( {{select {ao.pk},{cpf.numbervalue} "account" from {ConfiguredProductFeature as cpf join orderentry as oe on {cpf.orderentry}={oe.pk} join order as ao on {oe.order}={ao.pk}} where {qualifier} = 'account_number'}} ) acc

The above query is running fine but if i change it to

select {acc.pk} from ( {{select {ao.pk},{cpf.numbervalue} "account" from {ConfiguredProductFeature as cpf join orderentry as oe on {cpf.orderentry}={oe.pk} join order as ao on {oe.order}={ao.pk}} where {qualifier} = 'account_number'}} ) acc

I also tried but no luck

select {acc.pk} from ( {{select {ao.pk},{cpf.numbervalue} "account" from {ConfiguredProductFeature as cpf join orderentry as oe on {cpf.orderentry}={oe.pk} join order as ao on {oe.order}={ao.pk}} where {qualifier} = 'account_number'}} ) as acc

This gives me exception: cannot find (visible) type for alias acc within [].

The documentation says we can do it like this: https://wiki.hybris.com/display/release5/FlexibleSearch+Samples#FlexibleSearchSamples-SubselectoverSeveralTypes under "Reporting query with subselect"