I need some help regarding a complex query I am trying to run.
I have 2 tables. One called Document_List, one called File_Detail.
They both have docID, which is the relationship between the 2 tables.
I want to search this:
Give all rows from File_Detail
Where Document_List.Flag = 6
And File_detail.NotesID = 0
This is my attempt, its almost there, but the notesID = 0 is not working:
select p2.file_detail.* from p2.file_detail
left join p2.document_list on p2.file_detail.docnumber = p2.document_list.docnumber and p2.file_detail.notesid = 0
where p2.document_list.import_flag = 6;
Can anybody point out where I'm going wrong here please?
Thanks very much!