-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Von Grant Fugal wrote: | Are you just trying to get the desc from procedures scheduled for said | doctor? I think all you need is something like this: | 'select p.description from procedures p, fee_schedules fs where | p.id=fs.procedure_id and fs.doctor_id=$doctorid [and fs.id is null];' | I don't really understand the 'id is null' part, couldn't you then just | select description from procedures where id is null and get the same thing? | I must admit I don't really understand joins unless it does the same thing | as the above query. Anyway, does that help any?
Actually, he's trying to do the opposite -- the description of all procedures where doctor #2 is *not* associated with it via fee_schedules.
That's why he's using left joins + id is null. The left join forces each record from the left table to appear, but all columns from the right table will have NULLs if there was no match in the right table. Assumedly, the id field is declared as 'NOT NULL', so the only records in the result set where id is NULL are those where there is a record in the left table with no corresponding record in the right table.
Jacob -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.3 (GNU/Linux)
iD8DBQFABC24/PO7QochUiQRAjSkAKDKhVpx4/eVVDnY3Fu1Zcj4w2OYTgCgmvQc Qfdv0+YsqGonc1vuJvRWa/8= =JdCu -----END PGP SIGNATURE-----
____________________
BYU Unix Users Group http://uug.byu.edu/ ___________________________________________________________________
List Info: http://uug.byu.edu/cgi-bin/mailman/listinfo/uug-list
