Link to home
Start Free TrialLog in
Avatar of Charles Baldo
Charles BaldoFlag for United States of America

asked on

Need SQL Update

Hi

I have two tables

Create Table Doctor
(
    DoctorID as  Int,
    HasPatients as varchar(1)
)

Create Table Patient
(
     PatientID as Int,
     DoctorID as Int    
)

I need an update that sets Doctor.HasPatients ="Y" if the DoctorID is found in Patients.  Many Patients may have the same doctor some doctors will not see patients and therefore have no records in Patient Table

Thank You
ASKER CERTIFIED SOLUTION
Avatar of JesterToo
JesterToo
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Charles Baldo

ASKER

Worked well thanks