Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Get different sets of records from the same table
Message
De
11/08/2008 21:00:00
Jay Johengen
Altamahaw-Ossipee, Caroline du Nord, États-Unis
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
Get different sets of records from the same table
Versions des environnements
Visual FoxPro:
VFP 9 SP2
Divers
Thread ID:
01338221
Message ID:
01338221
Vues:
58
I need to get 2 different sets of records from the same lookup table (SystemLookups), but I can't quite figure out how to do it. It's almost like I need two different WHERE clauses. One for "ELIGRULE" and "RULETYPE" for another. Do I need to do this in 2 SQL Statements?
	SELECT ;
		ct.ptpn, ;
		ct.ptSSN AS SSN, ;
		ct.pt_DOB as DOB, ;
		ct.Pt_Name AS FullName, ;
		ct.PtFName AS FName, ct.PtMI AS MI, ct.PtLName AS LName, ;
		er.InsCarr, ;
		ct.CarrierName, ;
		m.DateOfService AS DateOfService, ;
		slpr.Descript AS PatientRule, ;
		er.RuleDesc AS CarrierRuleDesc, ;
		er.RuleType AS CarrierRuleCode, ;
		slpr.Descript AS CarrierRuleType, ;
		er.PeriodDays AS CarrierPeriodDays ;
		FROM cursorTemp ct ;
			JOIN SystemLookups slpr ON CursorTemp.EligRule = slpr.Value ;
			JOIN EligibilityRules er ON CursorTemp.InsCarr = er.InsCarr ;
			JOIN SystemLookups slrt ON er.RuleType = slrt.Value ;
		WHERE UPPER(slpr.FieldName) = 'ELIGRULE' OR ;
		WHERE UPPER(slrt.FieldName) = 'RULETYPE' ;
		INTO CURSOR EligibilityValidation READWRITE 
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform