>>>>I was trying to do a query like in the Visual FoxPro help file but got the "SQL - Subquery is invalid".
>>>>
>>>>code: select journal.summaryid from journal where journal.summaryid in (select main.summaryid, main.submitter from main where keywords like "%11B%")
>>>>
>>>>Thanks.
>>>Subquery should select one field here:
>>>select journal.summaryid from journal ;
>>> where journal.summaryid in ;
>>> (select main.summaryid from main where keywords like "%11B%")
Cetin
>>Thanks. That is working. Now, how can I get other information our from both the Journal and Main tables?
>Aha, that's slightly different.
select * from journal ;
> inner join main ;
> on journal.summaryid = main.summaryid
>* Or works in older versions too
>select * from journal, main ;
> where journal.summaryid = main.summaryid
Cetin
Thanks again! My difficulty was put in the last condition. Ahhh.. Finally I got ti straighten out as follows:
select journal.*, main.summaryid, main.submitter from journal, main where journal.summaryid=main.summaryid and journal.summaryid in (select summaryid from main where keywords like '%11B%')
I'll try "inner join" later to see if the line is shoter. I do need the submitter field from MAIN.DBF and all the fields in the JOURNAL.DBF to show a search result.