Skip to Main Content

Oracle Database Discussions

Announcement

For appeals, questions and feedback, please email oracle-forums_moderators_us@oracle.com

Retrieval of Data

user-ohv3uFeb 23 2023

I want to retrieve data from the following three tables.

Table 01. Patient Registration

Table 02. Patients Assessment

Table 03. Patients Sessions

The data written in tables 01, 02 is written once, while in table 03 the data is written multi times of the same patient on different visits.

I want to have the data from table 01, 02 that is written once, while the date written latest as per date Report_Date in table 03 with regard to patient id.

Table 01

<table><tbody><tr><td style="background-color:white;border:1.0pt solid windowtext;height:44.4pt;padding:0in 5.4pt;vertical-align:bottom;width:67.4pt;"><p style="text-align:center;"><span style="color:#404040;"><strong>PATIENT_ID</strong></span></p></td><td style="background-color:white;border-bottom-style:solid;border-color:windowtext;border-left-style:none;border-right-style:solid;border-top-style:solid;border-width:1.0pt;height:44.4pt;padding:0in 5.4pt;vertical-align:bottom;width:49.6pt;"><p style="text-align:center;"><span style="color:#404040;"><strong>REG_NO</strong></span></p></td><td style="background-color:white;border-bottom-style:solid;border-color:windowtext;border-left-style:none;border-right-style:solid;border-top-style:solid;border-width:1.0pt;height:44.4pt;padding:0in 5.4pt;vertical-align:bottom;width:55.7pt;"><p style="text-align:center;"><span style="color:#404040;"><strong>PATIENT_NAME</strong></span></p></td><td style="background-color:white;border-bottom-style:solid;border-color:windowtext;border-left-style:none;border-right-style:solid;border-top-style:solid;border-width:1.0pt;height:44.4pt;padding:0in 5.4pt;vertical-align:bottom;width:47.8pt;"><p style="text-align:center;"><span style="color:#404040;"><strong>FATHER_NAME</strong></span></p></td><td style="background-color:white;border-bottom-style:solid;border-color:windowtext;border-left-style:none;border-right-style:solid;border-top-style:solid;border-width:1.0pt;height:44.4pt;padding:0in 5.4pt;vertical-align:bottom;width:.75in;"><p style="text-align:center;"><span style="color:#404040;"><strong>GENDER</strong></span></p></td><td style="background-color:white;border-bottom-style:solid;border-color:windowtext;border-left-style:none;border-right-style:solid;border-top-style:solid;border-width:1.0pt;height:44.4pt;padding:0in 5.4pt;vertical-align:bottom;width:63.0pt;"><p style="text-align:center;"><span style="color:#404040;"><strong>FATHER_OCCUPATION</strong></span></p></td><td style="background-color:white;border-bottom-style:solid;border-color:windowtext;border-left-style:none;border-right-style:solid;border-top-style:solid;border-width:1.0pt;height:44.4pt;padding:0in 5.4pt;vertical-align:bottom;width:1.0in;"><p style="text-align:center;"><span style="color:#404040;"><strong>CONTACT_NO</strong></span></p></td><td style="background-color:white;border-bottom-style:solid;border-color:windowtext;border-left-style:none;border-right-style:solid;border-top-style:solid;border-width:1.0pt;height:44.4pt;padding:0in 5.4pt;vertical-align:bottom;width:67.5pt;"><p style="text-align:center;"><span style="color:#404040;"><strong>PERMANENT_ADDRESS</strong></span></p></td><td style="background-color:white;border-bottom-style:solid;border-color:windowtext;border-left-style:none;border-right-style:solid;border-top-style:solid;border-width:1.0pt;height:44.4pt;padding:0in 5.4pt;vertical-align:bottom;width:51.45pt;"><p style="text-align:center;"><span style="color:#404040;"><strong>DIAGNOSIS</strong></span></p></td><td style="background-color:white;border-bottom-style:solid;border-color:windowtext;border-left-style:none;border-right-style:solid;border-top-style:solid;border-width:1.0pt;height:44.4pt;padding:0in 5.4pt;vertical-align:bottom;width:67.25pt;"><p style="text-align:center;"><span style="color:#404040;"><strong>VACCINATED</strong></span></p></td></tr><tr><td style="background-color:white;border-bottom-style:solid;border-color:windowtext;border-left-style:solid;border-right-style:solid;border-top-style:none;border-width:1.0pt;height:44.4pt;padding:0in 5.4pt;vertical-align:bottom;width:67.4pt;"><p style="text-align:center;"><span style="color:#404040;"><strong>1</strong></span></p></td><td style="background-color:white;border-bottom:1.0pt solid windowtext;border-left-style:none;border-right:1.0pt solid windowtext;border-top-style:none;height:44.4pt;padding:0in 5.4pt;vertical-align:bottom;width:49.6pt;"><p style="text-align:center;">&nbsp;</p></td><td style="background-color:white;border-bottom:1.0pt solid windowtext;border-left-style:none;border-right:1.0pt solid windowtext;border-top-style:none;height:44.4pt;padding:0in 5.4pt;vertical-align:bottom;width:55.7pt;"><p style="text-align:center;">&nbsp;</p></td><td style="background-color:white;border-bottom:1.0pt solid windowtext;border-left-style:none;border-right:1.0pt solid windowtext;border-top-style:none;height:44.4pt;padding:0in 5.4pt;vertical-align:bottom;width:47.8pt;"><p style="text-align:center;">&nbsp;</p></td><td style="background-color:white;border-bottom:1.0pt solid windowtext;border-left-style:none;border-right:1.0pt solid windowtext;border-top-style:none;height:44.4pt;padding:0in 5.4pt;vertical-align:bottom;width:.75in;"><p style="text-align:center;">&nbsp;</p></td><td style="background-color:white;border-bottom:1.0pt solid windowtext;border-left-style:none;border-right:1.0pt solid windowtext;border-top-style:none;height:44.4pt;padding:0in 5.4pt;vertical-align:bottom;width:63.0pt;"><p style="text-align:center;">&nbsp;</p></td><td style="background-color:white;border-bottom:1.0pt solid windowtext;border-left-style:none;border-right:1.0pt solid windowtext;border-top-style:none;height:44.4pt;padding:0in 5.4pt;vertical-align:bottom;width:1.0in;"><p style="text-align:center;">&nbsp;</p></td><td style="background-color:white;border-bottom:1.0pt solid windowtext;border-left-style:none;border-right:1.0pt solid windowtext;border-top-style:none;height:44.4pt;padding:0in 5.4pt;vertical-align:bottom;width:67.5pt;"><p style="text-align:center;">&nbsp;</p></td><td style="background-color:white;border-bottom:1.0pt solid windowtext;border-left-style:none;border-right:1.0pt solid windowtext;border-top-style:none;height:44.4pt;padding:0in 5.4pt;vertical-align:bottom;width:51.45pt;"><p style="text-align:center;">&nbsp;</p></td><td style="background-color:white;border-bottom:1.0pt solid windowtext;border-left-style:none;border-right:1.0pt solid windowtext;border-top-style:none;height:44.4pt;padding:0in 5.4pt;vertical-align:bottom;width:67.25pt;"><p style="text-align:center;">&nbsp;</p></td></tr></tbody></table>

Table 02

<table><tbody><tr><td style="border:1.0pt solid windowtext;height:51.15pt;padding:0in 5.4pt;vertical-align:bottom;width:44.55pt;"><span style="color:black;"><strong>PATIENT_ID</strong></span></td><td style="border-bottom-style:solid;border-color:windowtext;border-left-style:none;border-right-style:solid;border-top-style:solid;border-width:1.0pt;height:51.15pt;padding:0in 5.4pt;vertical-align:bottom;width:66.85pt;"><span style="color:black;"><strong>ASSESSMENT_DATE</strong></span></td><td style="border-bottom-style:solid;border-color:windowtext;border-left-style:none;border-right-style:solid;border-top-style:solid;border-width:1.0pt;height:51.15pt;padding:0in 5.4pt;vertical-align:bottom;width:68.1pt;"><span style="color:black;"><strong>SCHOOL_ATTENDED</strong></span></td><td style="border-bottom-style:solid;border-color:windowtext;border-left-style:none;border-right-style:solid;border-top-style:solid;border-width:1.0pt;height:51.15pt;padding:0in 5.4pt;vertical-align:bottom;width:44.05pt;"><span style="color:black;"><strong>DIAGNOSIS</strong></span></td><td style="border-bottom-style:solid;border-color:windowtext;border-left-style:none;border-right-style:solid;border-top-style:solid;border-width:1.0pt;height:51.15pt;padding:0in 5.4pt;vertical-align:bottom;width:35.55pt;"><span style="color:black;"><strong>HISTORY</strong></span></td><td style="border-bottom-style:solid;border-color:windowtext;border-left-style:none;border-right-style:solid;border-top-style:solid;border-width:1.0pt;height:51.15pt;padding:0in 5.4pt;vertical-align:bottom;width:64.95pt;"><span style="color:black;"><strong>MEDICAL_HISTORY</strong></span></td><td style="border-bottom-style:solid;border-color:windowtext;border-left-style:none;border-right-style:solid;border-top-style:solid;border-width:1.0pt;height:51.15pt;padding:0in 5.4pt;vertical-align:bottom;width:78.6pt;"><span style="color:black;"><strong>CURRENT_MEDICATION</strong></span></td><td style="border-bottom-style:solid;border-color:windowtext;border-left-style:none;border-right-style:solid;border-top-style:solid;border-width:1.0pt;height:51.15pt;padding:0in 5.4pt;vertical-align:bottom;width:30.85pt;"><span style="color:black;"><strong>VISION</strong></span></td><td style="border-bottom-style:solid;border-color:windowtext;border-left-style:none;border-right-style:solid;border-top-style:solid;border-width:1.0pt;height:51.15pt;padding:0in 5.4pt;vertical-align:bottom;width:37.1pt;"><span style="color:black;"><strong>HEARING</strong></span></td><td style="border-bottom-style:solid;border-color:windowtext;border-left-style:none;border-right-style:solid;border-top-style:solid;border-width:1.0pt;height:51.15pt;padding:0in 5.4pt;vertical-align:bottom;width:35.55pt;"><span style="color:black;"><strong>FEEDING</strong></span></td><td style="border-bottom-style:solid;border-color:windowtext;border-left-style:none;border-right-style:solid;border-top-style:solid;border-width:1.0pt;height:51.15pt;padding:0in 5.4pt;vertical-align:bottom;width:37.85pt;"><span style="color:black;"><strong>SLEEPING</strong></span></td><td style="border-bottom-style:solid;border-color:windowtext;border-left-style:none;border-right-style:solid;border-top-style:solid;border-width:1.0pt;height:51.15pt;padding:0in 5.4pt;vertical-align:bottom;width:103.5pt;"><span style="color:black;"><strong>INFORMATION_FROM_PARENTS</strong></span></td></tr><tr><td style="border-bottom-style:solid;border-color:windowtext;border-left-style:solid;border-right-style:solid;border-top-style:none;border-width:1.0pt;height:51.15pt;padding:0in 5.4pt;vertical-align:bottom;width:44.55pt;"><span style="color:black;"><strong>1</strong></span></td><td style="border-bottom:1.0pt solid windowtext;border-left-style:none;border-right:1.0pt solid windowtext;border-top-style:none;height:51.15pt;padding:0in 5.4pt;vertical-align:bottom;width:66.85pt;">&nbsp;</td><td style="border-bottom:1.0pt solid windowtext;border-left-style:none;border-right:1.0pt solid windowtext;border-top-style:none;height:51.15pt;padding:0in 5.4pt;vertical-align:bottom;width:68.1pt;">&nbsp;</td><td style="border-bottom:1.0pt solid windowtext;border-left-style:none;border-right:1.0pt solid windowtext;border-top-style:none;height:51.15pt;padding:0in 5.4pt;vertical-align:bottom;width:44.05pt;">&nbsp;</td><td style="border-bottom:1.0pt solid windowtext;border-left-style:none;border-right:1.0pt solid windowtext;border-top-style:none;height:51.15pt;padding:0in 5.4pt;vertical-align:bottom;width:35.55pt;">&nbsp;</td><td style="border-bottom:1.0pt solid windowtext;border-left-style:none;border-right:1.0pt solid windowtext;border-top-style:none;height:51.15pt;padding:0in 5.4pt;vertical-align:bottom;width:64.95pt;">&nbsp;</td><td style="border-bottom:1.0pt solid windowtext;border-left-style:none;border-right:1.0pt solid windowtext;border-top-style:none;height:51.15pt;padding:0in 5.4pt;vertical-align:bottom;width:78.6pt;">&nbsp;</td><td style="border-bottom:1.0pt solid windowtext;border-left-style:none;border-right:1.0pt solid windowtext;border-top-style:none;height:51.15pt;padding:0in 5.4pt;vertical-align:bottom;width:30.85pt;">&nbsp;</td><td style="border-bottom:1.0pt solid windowtext;border-left-style:none;border-right:1.0pt solid windowtext;border-top-style:none;height:51.15pt;padding:0in 5.4pt;vertical-align:bottom;width:37.1pt;">&nbsp;</td><td style="border-bottom:1.0pt solid windowtext;border-left-style:none;border-right:1.0pt solid windowtext;border-top-style:none;height:51.15pt;padding:0in 5.4pt;vertical-align:bottom;width:35.55pt;">&nbsp;</td><td style="border-bottom:1.0pt solid windowtext;border-left-style:none;border-right:1.0pt solid windowtext;border-top-style:none;height:51.15pt;padding:0in 5.4pt;vertical-align:bottom;width:37.85pt;">&nbsp;</td><td style="border-bottom:1.0pt solid windowtext;border-left-style:none;border-right:1.0pt solid windowtext;border-top-style:none;height:51.15pt;padding:0in 5.4pt;vertical-align:bottom;width:103.5pt;">&nbsp;</td></tr></tbody></table>

Table 03

<table><tbody><tr><td style="border:1.0pt solid windowtext;height:55.45pt;padding:0in 5.4pt;vertical-align:bottom;width:60.3pt;"><span style="color:black;"><strong>PATIENT_ID</strong></span></td><td style="border-bottom-style:solid;border-color:windowtext;border-left-style:none;border-right-style:solid;border-top-style:solid;border-width:1.0pt;height:55.45pt;padding:0in 5.4pt;vertical-align:bottom;width:127.75pt;"><span style="color:black;"><strong>PARENT_HOMEWORK_REPORT</strong></span></td><td style="border-bottom-style:solid;border-color:windowtext;border-left-style:none;border-right-style:solid;border-top-style:solid;border-width:1.0pt;height:55.45pt;padding:0in 5.4pt;vertical-align:bottom;width:69.05pt;"><span style="color:black;"><strong>PARENT_ABILITY</strong></span></td><td style="border-bottom-style:solid;border-color:windowtext;border-left-style:none;border-right-style:solid;border-top-style:solid;border-width:1.0pt;height:55.45pt;padding:0in 5.4pt;vertical-align:bottom;width:63.25pt;"><span style="color:black;"><strong>INTERVENTION</strong></span></td><td style="border-bottom-style:solid;border-color:windowtext;border-left-style:none;border-right-style:solid;border-top-style:solid;border-width:1.0pt;height:55.45pt;padding:0in 5.4pt;vertical-align:bottom;width:77.6pt;"><span style="color:black;"><strong>MATTERS_ARISING</strong></span></td><td style="border-bottom-style:solid;border-color:windowtext;border-left-style:none;border-right-style:solid;border-top-style:solid;border-width:1.0pt;height:55.45pt;padding:0in 5.4pt;vertical-align:bottom;width:38.8pt;"><span style="color:black;"><strong>VISIT_ID</strong></span></td><td style="border-bottom-style:solid;border-color:windowtext;border-left-style:none;border-right-style:solid;border-top-style:solid;border-width:1.0pt;height:55.45pt;padding:0in 5.4pt;vertical-align:bottom;width:77.15pt;"><span style="color:black;"><strong>NEW_HOMEWORK</strong></span></td><td style="border-bottom-style:solid;border-color:windowtext;border-left-style:none;border-right-style:solid;border-top-style:solid;border-width:1.0pt;height:55.45pt;padding:0in 5.4pt;vertical-align:bottom;width:95.75pt;"><span style="color:black;"><strong>REPORT_DATE</strong></span></td></tr><tr><td style="border-bottom-style:solid;border-color:windowtext;border-left-style:solid;border-right-style:solid;border-top-style:none;border-width:1.0pt;height:24.45pt;padding:0in 5.4pt;vertical-align:bottom;width:60.3pt;"><span style="color:black;"><strong>1</strong></span></td><td style="border-bottom:1.0pt solid windowtext;border-left-style:none;border-right:1.0pt solid windowtext;border-top-style:none;height:24.45pt;padding:0in 5.4pt;vertical-align:bottom;width:127.75pt;"><span style="color:black;"><strong>Details</strong></span></td><td style="border-bottom:1.0pt solid windowtext;border-left-style:none;border-right:1.0pt solid windowtext;border-top-style:none;height:24.45pt;padding:0in 5.4pt;vertical-align:bottom;width:69.05pt;">&nbsp;</td><td style="border-bottom:1.0pt solid windowtext;border-left-style:none;border-right:1.0pt solid windowtext;border-top-style:none;height:24.45pt;padding:0in 5.4pt;vertical-align:bottom;width:63.25pt;">&nbsp;</td><td style="border-bottom:1.0pt solid windowtext;border-left-style:none;border-right:1.0pt solid windowtext;border-top-style:none;height:24.45pt;padding:0in 5.4pt;vertical-align:bottom;width:77.6pt;">&nbsp;</td><td style="border-bottom:1.0pt solid windowtext;border-left-style:none;border-right:1.0pt solid windowtext;border-top-style:none;height:24.45pt;padding:0in 5.4pt;vertical-align:bottom;width:38.8pt;">&nbsp;</td><td style="border-bottom:1.0pt solid windowtext;border-left-style:none;border-right:1.0pt solid windowtext;border-top-style:none;height:24.45pt;padding:0in 5.4pt;vertical-align:bottom;width:77.15pt;">&nbsp;</td><td style="border-bottom:1.0pt solid windowtext;border-left-style:none;border-right:1.0pt solid windowtext;border-top-style:none;height:24.45pt;padding:0in 5.4pt;vertical-align:bottom;width:95.75pt;"><span style="color:black;"><strong>01-Jan-23</strong></span></td></tr><tr><td style="border-bottom-style:solid;border-color:windowtext;border-left-style:solid;border-right-style:solid;border-top-style:none;border-width:1.0pt;height:29.6pt;padding:0in 5.4pt;vertical-align:bottom;width:60.3pt;"><span style="color:black;"><strong>1</strong></span></td><td style="border-bottom:1.0pt solid windowtext;border-left-style:none;border-right:1.0pt solid windowtext;border-top-style:none;height:29.6pt;padding:0in 5.4pt;vertical-align:bottom;width:127.75pt;"><span style="color:black;"><strong>Details</strong></span></td><td style="border-bottom:1.0pt solid windowtext;border-left-style:none;border-right:1.0pt solid windowtext;border-top-style:none;height:29.6pt;padding:0in 5.4pt;vertical-align:bottom;width:69.05pt;">&nbsp;</td><td style="border-bottom:1.0pt solid windowtext;border-left-style:none;border-right:1.0pt solid windowtext;border-top-style:none;height:29.6pt;padding:0in 5.4pt;vertical-align:bottom;width:63.25pt;">&nbsp;</td><td style="border-bottom:1.0pt solid windowtext;border-left-style:none;border-right:1.0pt solid windowtext;border-top-style:none;height:29.6pt;padding:0in 5.4pt;vertical-align:bottom;width:77.6pt;">&nbsp;</td><td style="border-bottom:1.0pt solid windowtext;border-left-style:none;border-right:1.0pt solid windowtext;border-top-style:none;height:29.6pt;padding:0in 5.4pt;vertical-align:bottom;width:38.8pt;">&nbsp;</td><td style="border-bottom:1.0pt solid windowtext;border-left-style:none;border-right:1.0pt solid windowtext;border-top-style:none;height:29.6pt;padding:0in 5.4pt;vertical-align:bottom;width:77.15pt;">&nbsp;</td><td style="border-bottom:1.0pt solid windowtext;border-left-style:none;border-right:1.0pt solid windowtext;border-top-style:none;height:29.6pt;padding:0in 5.4pt;vertical-align:bottom;width:95.75pt;"><span style="color:black;"><strong>20-Feb-23</strong></span></td></tr></tbody></table>
Comments
Post Details
Added on Feb 23 2023
3 comments
85 views