22 Jul
1999
22 Jul
'99
3:05 a.m.
Hi. I'm building a loan system with Zap and I have a SQl statement problem. Let's say I have 2 table: loan and doc
Fields in doc: pno * doctype * docloc ...
Fields in loan: usrid * pno * doctype * ... Note: * means primary key
What I want to query is how do I get all the pno and its according type, that doesn't exist in the loan table? This is to make sure that the borrower does not select a document that had been loaned!!! In other words, all documents except those that are being borrowed.
How 'bout: SELECT * from doc WHERE pno NOT IN (SELECT pno FROM loan) --Rob