Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
FoxPro - no subqueries?
Message
 
To
15/07/1998 13:11:59
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00117676
Message ID:
00117696
Views:
122
>>>>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.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform