Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Data Bases > Xbase Fox > I need help wit...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 2 Topic 849 of 861
Post > Topic >>

I need help with joining derived tables in VFP 9

by F.Qutaifan@[EMAIL PROTECTED] Jun 26, 2008 at 12:56 AM

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.
 




 2 Posts in Topic:
I need help with joining derived tables in VFP 9
F.Qutaifan@[EMAIL PROTECT  2008-06-26 00:56:56 
Re: I need help with joining derived tables in VFP 9
AddictedtoJava <F.Quta  2008-06-26 02:57:50 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Fri Dec 5 10:10:38 CST 2008.