Skip to end of banner
Go to start of banner

How to show all table rows when using query in a query

Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 6 Next »

This article explains how to show all table rows when using a query in a query by using SQL for Confluence app.

Instructions

  1.  It uses a join query, one query depends in data provided by the other query. Write the below query in a SQL Query macro and select Output format as Wiki.

    select
    tpa.MRN, 
    '{sql-query:dataSource=Test} 
    SELECT
    tp.WPR_ID ,tpp.TEST_PATIENT_ID
    FROM TEST_PROXY tp
    JOIN TEST_PATIENT_PROXY tpp ON tpp.TEST_PROXY_USERNAME = tp.USERNAME
    WHERE tpp.TEST_PATIENT_ID =' + CONVERT(VARCHAR(12),tpa.ID) + 
    ' {sql-query}' 
    as "Proxy"
    from TEST_PATIENT tpa
  2. The output of the above query as shown below:


  • No labels