Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SQL FROM SQL
Message
From
22/01/2009 08:19:00
Jay Johengen
Altamahaw-Ossipee, North Carolina, United States
 
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
Miscellaneous
Thread ID:
01375790
Message ID:
01376265
Views:
11
>>>
>>>SELECT InsCarr.CarName, Seq, Rec FROM InsCarr JOIN (SELECT PADL( Seq_Num, 4, '0' ) AS Seq, RECNO() AS Rec FROM covr WITH (BUFFERING=.T.) ;
>>>WHERE Pat_No=Patient.PtPn AND CvPS=InsuranceLevel AND ! DELETED() ) ;
>>>Covr ON InsCarr.InsCarr=Covr.cvCarr ;
>>>ORDER BY 1 INTO CURSOR CarrierList
>>
>>I had to just add cvCarr to the inner SQL, but that worked. I don't fully understand it, but it worked. Thanks!
>
>Finally! :)
>
>No problem, glad to help.

Related question. After a record has been added to Covr table, there is no corresponding InsCarr record at that point. My SQL is only returning 2 records because
it's looking at InsCarr matches and that's all it finds. How can I get all three records from Covr regardless of what is in InsCarr?
SELECT Seq,CarName,Rec ;
	FROM InsCarr ;
	JOIN (SELECT PADL(Seq_Num,4,'0') AS Seq,RECNO() AS Rec,cvCarr ;
		FROM covr WITH (BUFFERING=.T.) ;
		WHERE Pat_No=Patient.PtPn AND CvPS=THISFORMInsuranceLevel AND ! DELETED() ) Covr ;
		ON InsCarr=cvCarr ;
	ORDER BY 1 ;
	INTO CURSOR SequenceList
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform