What Method do you use to pull data of an orcurrence when 2people see the same person during a certain period

From: Jaswinder Suri <Jaswinder.Suri_at_msdw.com>
Date: Fri, 10 Dec 1999 11:26:29 +0000
Message-ID: <3850E365.AEA1BFED_at_msdw.com>



[Quoted] Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit

Hello,
I Require The following output : output 3

D_name             Patie     Patie     Sv_Date
--------             -----     -----     ---------
Mr Hussein       f4221    f4221   21-AUG-99
Mr Hussein       f4221    f4221   17-SEP-99
Mr Hussein       f4221    f4221   18-SEP-99
Miss Brown      f4221    f4221   24-AUG-99

I could do the following

Select Appointment.D_name,
Appointment.Patient_no,Patient.Patient_no, Appointment.Sv_date
from Appointment, Patient
where Appointment.Patient_no = Patient.Patient_no and

           Appointment.D_name ='Mr Hussein' or Appointment.D_name ='Miss Brown' and

[Quoted]            Appointment.Sv_date Between to_date('01-AUG-99') and

to_date('30-SEP-99');

I can not use (and) between the two dentist names as this will return no records
But this pulls in the record of patient M1321

[Quoted] [Quoted] D_name            Patie      Patie        Sv_Date
-------------     ------     ------      -------------
Miss Brown      f4221     f4221      24-AUG-99
Miss Brown      M1321  M1321    30-SEP-99
Mr Hussein       f4221     f4221      21-AUG-99
Mr Hussein       f4221     f4221     17-SEP-99
Mr Hussein       f4221     f4221     18-SEP-99

Miss Brown     M1321 M1321 30-SEP-99  who was seen by Miss Brown only

I can not use (and) between the two dentist names as this will return no records

I have had a few suggestion but i have found they produce a similar output.

Any suggestion on what method I need to achieve this result will be appreciated.

Thank You very much,

Jas Suri,

--------------84063FFCDEE9D6B062B0BF3C
[Quoted] [Quoted] Content-Type: text/html; charset=us-ascii
Content-Transfer-Encoding: 7bit

[Quoted] [Quoted] <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>

Hello,
<BR>I Require The following&nbsp; output : output 3
<P>D_name&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
[Quoted] [Quoted] Patie&nbsp;&nbsp;&nbsp;&nbsp; Patie&nbsp;&nbsp;&nbsp;&nbsp; Sv_Date
<BR>--------&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
[Quoted] -----&nbsp;&nbsp;&nbsp;&nbsp; -----&nbsp;&nbsp;&nbsp;&nbsp; ---------
<BR>Mr Hussein&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; f4221&nbsp;&nbsp;&nbsp;
f4221&nbsp;&nbsp; 21-AUG-99
<BR>Mr Hussein&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; f4221&nbsp;&nbsp;&nbsp;
f4221&nbsp;&nbsp; 17-SEP-99
<BR>Mr Hussein&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; f4221&nbsp;&nbsp;&nbsp;
f4221&nbsp;&nbsp; 18-SEP-99
<BR>Miss Brown&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; f4221&nbsp;&nbsp;&nbsp; f4221&nbsp;&nbsp;
24-AUG-99
<P>I could do the following
[Quoted] <P>Select Appointment.D_name, Appointment.Patient_no,Patient.Patient_no,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
Appointment.Sv_date
<BR>from Appointment, Patient
<BR>where&nbsp; Appointment.Patient_no = Patient.Patient_no and
<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Appointment.D_name
='Mr Hussein' or Appointment.D_name ='Miss Brown' and
<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Appointment.Sv_date
Between to_date('01-AUG-99') and
[Quoted] [Quoted] <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
to_date('30-SEP-99');
<P>I can not use (and) between the two dentist names as this will return
no records
<BR>But this pulls in the record of patient M1321
<P>D_name&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
[Quoted] Patie&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Patie&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Sv_Date
[Quoted] <BR>-------------&nbsp;&nbsp;&nbsp;&nbsp; ------&nbsp;&nbsp;&nbsp;&nbsp;
------&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -------------
<BR>Miss Brown&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; f4221&nbsp;&nbsp;&nbsp;&nbsp;
f4221&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 24-AUG-99
[Quoted] <BR><FONT COLOR="#FF0000">Miss Brown&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; M1321&nbsp;
[Quoted] [Quoted] M1321&nbsp;&nbsp;&nbsp; 30-SEP-99</FONT>
<BR>Mr Hussein&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; f4221&nbsp;&nbsp;&nbsp;&nbsp;
f4221&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 21-AUG-99
<BR>Mr Hussein&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; f4221&nbsp;&nbsp;&nbsp;&nbsp;
f4221&nbsp;&nbsp;&nbsp;&nbsp; 17-SEP-99
<BR>Mr Hussein&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; f4221&nbsp;&nbsp;&nbsp;&nbsp;
f4221&nbsp;&nbsp;&nbsp;&nbsp; 18-SEP-99
[Quoted] [Quoted] <P>Miss Brown&nbsp;&nbsp;&nbsp;&nbsp; M1321 M1321 30-SEP-99&nbsp; who was
seen by Miss Brown only
<P>I can not use (and) between the two dentist names as this will return
no records
<P>I have had a few suggestion but i have found they produce a similar
output.
<P>Any suggestion on what method I need to achieve this result will be
appreciated.
<BR>&nbsp;
<P>Thank You very much,
<P>Jas Suri,</HTML>

--------------84063FFCDEE9D6B062B0BF3C-- Received on Fri Dec 10 1999 - 12:26:29 CET

Original text of this message