Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Some help with a sub-query
Message
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00637702
Message ID:
00637725
Views:
16
This message has been marked as the solution to the initial question of the thread.
Caroline,

sorry, I should have read your message more carefully, to see what you mean exactly.

How about this one:
Select Exhibit.iid, Exhibit.nkey, Links.* ;

  FROM Exhibit ;

  LEFT JOIN Links ;
  ON Exhibit.iid = Links.iwork ;

  WHERE Links.itype in (1,0) OR Links.itype IS NULL ;
  GROUP BY Exhibit.iid, links.iwork;
  INTO CURSOR Linked
Here we get ...
- all records from exhibit joined with all records from links which are of type 1 or 0 and all records from exhibit that don't have a record in links.
- then group the result, so we get a resulting record per exhibit.iid/links.iwork

Am I getting closer to what you want or am I still missing something?

Armin

Armin Neudert
Regional Director (Stuttgart) of German FoxPro User Group dFPUG

MCP for Visual FoxPro

Expert/Editor of the VFP section in the German Codezone community portal
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform