I have three derived tables generated by select some columns from the
same tabel . I have written SQL statements to summarize the
information of each table based on certain columns in the main table.I
wrote an SQL statement where in it sql should perform the
summarization of each of the three derived tables separately and then
the summarized results be joined together using where clause.
My query is as follows:
SELECT tb1.gs7usr as User, tb1.ADD, tb2.UPD, tb3.DEL from
(SELECT B.gs7usr,COUNT(B.GS7nin)as ADD FROM RGS8 B where
B.GS7act='ADD'and B.gs7dte=20080310 and B.GS7tme=(select Max(E.GS7tme)
AS tme from RGS8 E where e.gs7nin=b.gs7nin) GROUP BY B.GS7USR) as tb1
FULL JOIN (SELECT A.gs7usr,COUNT(A.GS7nin)as UPD FROM RGS8 a where
A.GS7act='UPD'and A.gs7dte=20080310 and A.GS7tme=(select Max(D.GS7tme)
AS tme from RGS8 D where D.gs7nin=A.gs7nin) GROUP BY a.GS7USR)as tb2
ON tb1.GS7usr = tb2.gs7usr
FULL JOIN (SELECT c.gs7usr,COUNT(c.GS7nin)as DEL FROM RGS8 c where
c.GS7act='DEL' and c.gs7dte=20080310 and c.GS7tme=(select
Max(f.GS7tme) AS tme from RGS8 f where c.gs7nin=f.gs7nin) GROUP BY
c.GS7USR) as tb3 ON tb1.gs7usr=tb3.gs7usr order by tb1.gs7usr
But VFP V9 keep on displaying the same erroreach time I try to
execute the query and that is "Command contains unrecognized phrase/
keyword " It worth mentioning that each query executes sucessflly when
it is written in a separate query even if I tired the query with
joining 2 tables only I still get the same error.