Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Some help with a sub-query
Message
From
27/03/2002 06:21:47
 
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00637702
Message ID:
00637716
Views:
13
>Hi all,
>
>I'm new to sub-queries and I was wondering if it was possible to combine the following into one select statement using a sub-query.
>
>
>Select * ;
>FROM Links;
>WHERE Links.itype in (1,0);
>GROUP BY links.iwork;
>INTO CURSOR Linked
>
>SELECT Exhibit.iid, Exhibit.nkey, linked.*;
>FROM Exhibit LEFT OUTER JOIN Linked ON Exhibit.iid =Linked.iwork
>
>
>Any help would be greatly appreciated.

Caroline,

Does this approach what you're after ?
select	Exhibit.iid, ;
	Exhibit.nkey, ;
	L1.* ;
    from Exhibit, Links L1 ;
    where    ( Exhibit.iid ;
		in	( select Distinct L2.iwork ;
				from Links L2 ;
 			   where    ( L2.itype in (0,1) ) ; 
			) ;
		) ;
	   and	( Exhibit.iid == L1.iWork )
Gregory
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform