Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

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

Instructions

  1.  Following  The following query is an example that uses a join and provides data to an outer query. Write the below code in a SQL Query macro and select Output format as Wiki.

    Code Block
    themeMidnight
    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

    Image Added

  2. The output of the above query is as shown below:


...