Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Help with PostgreSQL Query
Message
From
18/10/2009 13:11:47
 
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 9 SP1
Miscellaneous
Thread ID:
01429771
Message ID:
01429784
Views:
59
>Dear all
>I am trying to execute the following query in postgresql, but keep getting errors ("error near group by"). Tried to run it in pgadmin's query tool, and got different errors ( like IIF not recognized ). Can anyone help me "translate" the sql from vfp to postgre?
>Table name in postgre: weblog
>Fields: agent C(4), function varchar(20), xmlstr text
>
>lcStr = [select weblog.agent, ]+;
>[sum(iif(weblog.function="GetCars" or "GETCARS"$weblog.xmlstr,1,0)) as RateRequests,]+;
>[sum(iif(weblog.function="CarRes" or "CARRES"$weblog.xmlstr,1,0)) as Bookings ]+;
>[from weblog order by weblog.agent group by weblog.agent]
>=sqlexec( oConnection,  lcStr, "TempCursor" )
>
>TIA
>Jaime
[from weblog group by weblog.agent order by weblog.agent]
Previous
Reply
Map
View

Click here to load this message in the networking platform