Skip to Main Content

APEX

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

How can I conditionally display entries in a column as links only if a query does not come up empty?

PearlJul 15 2021

I have a table that looks like the following:
image.pngThe SQL query I used for this interactive report (static ID = 'STEM') is as follows:

select MOCKSTEMS.WORD_ID,
       MOCKSTEMS.STEM_ID,
       MOCKSTEMS.LABSTEM,
       MOCKSTEMS.LABSTEMCATEGORY,
       MOCKLEMMAS.LEMMAFORM,
       MOCKSTEMS.LEMMA_ID,
       MOCKWORDS.ORIGINALWORD,
       MOCKSTEMS.CONTAINEDIN
from MOCKSTEMS
inner join MOCKWORDS on MOCKSTEMS.WORD_ID = MOCKWORDS.WORD_ID
inner join MOCKLEMMAS on MOCKSTEMS.LEMMA_ID = MOCKLEMMAS.LEMMA_ID

There are 2 interactive reports on this page; the other one (static ID = 'MORPH') has the following query:

select MOCKSTEMS.WORD_ID,
       MOCKSTEMS.STEM_ID,
       MOCKMORPHS.MORPHEME_ID,
       MOCKMORPHS.LABMORPHEME,
       MOCKMORPHS.LABMORPHEMECATEGORY,
       MOCKLEMMAS.LEMMAFORM,
       MOCKMORPHS.LEMMA_ID,
       MOCKWORDS.ORIGINALWORD
from MOCKMORPHS
inner join MOCKSTEMS on MOCKMORPHS.STEM_ID = MOCKSTEMS.STEM_ID
inner join MOCKWORDS on MOCKSTEMS.WORD_ID = MOCKWORDS.WORD_ID
inner join MOCKLEMMAS on MOCKMORPHS.LEMMA_ID = MOCKLEMMAS.LEMMA_ID

Currently, the 'Lab Stem' column contains links that applies a filter on each of the 2 interactive reports on this page (page 11):
image.pngHowever, I only want to display the entry as a link (i.e. in blue text) if there are results in either the STEM interactive report or the MORPH interactive report with the filters applied.
How can I do this?
I'm thinking I could create a column in my SQL query that counts the number of rows that would satisfy my condition, but I'm not quite sure how to incorporate that into my current SQL query.
Any help would be appreciated. Thank you!

Comments

Processing

Post Details

Added on Jul 15 2021
7 comments
1,285 views