asked on
zSS_ndc_medid
NDC |MEDID |GNI
-------------------------
1001 |11 |2
1002 |11 |2
1003 |11 |3
1004 |11 |2
1005 |13 |2
1006 |16 |2
zSS_formulary_list
NDC |List_ID |Provider |Status
-----------------------------------------------------------------
1001 |FSL101 |RXHUBPBM |2
1002 |FSL101 |RXHUBPBM |2
1003 |FSL101 |RXHUBPBM |5
1004 |FSL101 |RXHUBPBM |2
1001 |FSL102 |RXHUBPBM |2
1002 |FSL102 |RXHUBPBM |2
1003 |FSL103 |RXHUBPBM |5
1004 |FSL104 |RXHUBPBM |2
RM_MEDID
MED_ID |Name |
---------------------------------
11 |One |
13 |Two |
16 |Three |
ASKER
SELECT {column list}
FROM zSS_ndc_media a
LEFT JOIN RM_MEDID b ON a.MEDID = b.MED_ID
LEFT JOIN zSS_formulary_list c ON c.NDC = a.NDC
AND c.List_ID = 'FSL101' AND c.Provider = 'RXHUBPBM'
;
PHP is a widely-used server-side scripting language especially suited for web development, powering tens of millions of sites from Facebook to personal WordPress blogs. PHP is often paired with the MySQL relational database, but includes support for most other mainstream databases. By utilizing different Server APIs, PHP can work on many different web servers as a server-side scripting language.
TRUSTED BY
ASKER
Since the table names and fields are slightly different in the production databse my actual query is as follows:
Open in new window
Thanks again for the help.