title: Join two tables with null value
body: <p>I've got table <code>Visit</code> with columns like <code>VisitID</code>, <code>PatientID</code>, <code>DoctorID</code> etc. and also column <code>PrescriptionID</code>. In table <code>Prescription</code> there are columns <code>PrescriptionID</code> and <code>DrugID</code> (together they are my primary key). One prescription can have many drugs, so there will be something like:</p>
  
  <p>PrescriptionID: 1 DrugID: 38<Br>
  PrescriptionID: 1 DrugID: 278<Br>
  PrescriptionID: 1 DrugID: 7<Br></p>
  
  <p>In <code>Visit</code> table there will be inserted '1' value as <code>PrescriptionID</code>. But now I can't join those two tables with foreign key, because not every visit have prescription, so <code>PrescriptionID</code> can be null and I've got error that column must be primary key or must be unique. How can I join those tables in another way?</p>