Hi Pankajtiwary :-)
Thanks for the reply. Unfortunately your query will not work as it does not match my table structure. This is the statement I used to create my table with all the data elements: The combination of Hospital Code and Sequence number idenitifies a patient. I hope this clarifies the question.
CREATE TABLE ATTENDS_EXAM
( Doctor_Name varchar(30) not NULL,
Hospital_Code char(2) not NULL,
Sequence_Number int not NULL,
Time_of_Exam time not NULL,
Examination_Date date not NULL,
PRIMARY KEY (Doctor_Name, Hospital_Code, Sequence_Number, Time_of_Exam, Examination_Date)
);
Main Topics
Browse All Topics





by: pankajtiwaryPosted on 2004-10-24 at 17:35:22ID: 12396428
Hi kinko899,
Try this one.
doctor_name is the name of the doctor and no_of_patients is the number of patients.
select doctor_name, no_of_patients from attends_exam where examination_date > 20041017 and no_of_patients=max(no_of patients) ;
Cheers!