SELECT Master.Numero,Master.FirstName,Master.LastName,'MasterType.Title_A, ; MasterType.Title_F,Master.Bio_A,Master.Bio_F,; UPPER(Master.LastName) AS LastName2,UPPER(Master.FirstName) AS FirstName2; FROM Master; INNER JOIN MasterType ON Master.NoMasterT=MasterType.Numero; INNER JOIN ON Master.NoMasterT=MasterType.Numero; JOIN ( ; SELECT NoMaster AS Numero FROM Style; UNION SELECT NoMaster2 AS Numero FROM Style) temp ; ON Master.Numero=Temp.Numero ; ORDER BY LastName2,FirstName2>When doing it with VFP code, I was using two SQL to obtain the desired data. Basically, I was getting one cursor from unions for the first SQL like this:
>SELECT NoMaster AS Numero FROM Style; > UNION SELECT NoMaster2 AS Numero FROM Style; > GROUP BY 1 INTO CURSOR Temp >lcInnerJoin='INNER JOIN Temp ON Master.Numero=Temp.Numero' >>
>SELECT Master.Numero,Master.FirstName,Master.LastName,'MasterType.Title_A, MasterType.Title_F,Master.Bio_A,Master.Bio_F,; > UPPER(Master.LastName) AS LastName2,UPPER(Master.FirstName) AS FirstName2; > FROM Master; > INNER JOIN MasterType ON Master.NoMasterT=MasterType.Numero; > INNER JOIN ON Master.NoMasterT=MasterType.Numero; > &lcInnerJoin ORDER BY LastName2,FirstName2 >>