Skip to Main Content

SQL & PL/SQL

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.

Self join sub query help

763735Mar 30 2010 — edited Mar 31 2010
This is my table

Doctor Appointment Date Rating
111 23/12/2009 G1
111 23/12/2009 G2
111 23/12/2009 B
111 23/12/2009 D
111 23/12/2008 G1
111 23/12/2008 B
111 23/12/2007 G2
111 23/12/2007 B
111 23/12/2006 D

For Doctor 111, on a given appointment date he has multiple ratings.

I have to fetch the rows (with doctor id, appointment date)
I) which does not have G1 rating but has G2 rating for each appointment date
And vice versa ( does not have G2 rating but has G1 rating for each appointment date)
And
II) if the particular appointment date has both G1 and G2 rating then I can ignore that appointment date – i.e do not fetch any rows if that appointment date has both G1 and G2 ratings.
And
III) if the appointment date has no G1 or G2 rating, then display the appointment date and the doctor.
So, my result set should have the output from all the three conditions for each doctor.

I am not sure how it works. I am trying using correlated subqueries any suggestions???

Comments

TexasApexDeveloper
See this article from oracle on creating a packaged Oracle APEX application..: http://download.oracle.com/docs/cd/E14373_01/appdev.32/e11838/deploy.htm#CHDICGJD

Thank you,

Tony Miller
Webster, TX
Fadi Samara Guest
I read this one before and now but could not still find the way how to get the tables' data unloaded and exported with the application itself, if you know how to do that could you please mention it here.
828941
Hi,

I use the following method.

Step 1—_
You need DDL for database objects. You can follow any of the following 2 methods:-
Method 1
• In APEX Go to Home .
• Click on Utilities
• Click on Generate DDL
• Click on Create Script button
• Select the Schema and Click on next
• For output select Save as Script File and the objects types which you want to include in the script and click on next
• Check the individual object name which you want include in the script and click on Generate DDL.
• Download the Script File you generated to you Hard Drive.

Method 2
• Using SQL Developer Export the Schema and save the file you hard drive. (I use this method as it is easy and i can copy the data as well)
Step 2 –_
• Go to the application which you want to export
• Click on Supporting Objects.
• Click on Installation Script.
• Click on Create From File.
• Enter name of Installation script and click Next
• Browse the file which you downloaded in Step 1 and Click on Create Script
• Now Click on Export/Import Link on the Application Home Page
• Click on Export
• In the Export Preference Select Export Support Object Definition and Click on Export

This exported file will install both the application as well as database object*

Regards,
Shijesh
Fadi Samara Guest
Hi,

Thanks for that, but I need the Data inside the tables to be exported, I think they called seed data, I'm not after the ddl.

thanks,
828941
Answer
Follwing Method 2 ---

IN SQL Developer .. click on tools database export and follow the on screen instruction.. i use this method to export object and data both.

Regards,
Shijesh
Marked as Answer by Fadi Samara Guest · Sep 27 2020
1 - 5
Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Apr 28 2010
Added on Mar 30 2010
4 comments
1,618 views