Re: what is the syntax error in this code?its a small code
Posted in 2008
On Jun 22, 1:52 pm, "Art Kagel" <art.ka...@gmail.com> wrote:
> IDS 10.00 does NOT support derived tables (ie a select in the FROM clause
> acting as a table). That syntax is first supported in IDS 11.10. You can
> unwind this to a simple query as:
>
> SELECT loc.location, loc.code, acc.descr, count(loc.reqd_for) AS> CountReqdfor
> FROM informix.loc_accessorials loc, informix.accessorial acc
> WHERE loc.code=acc.code AND loc.code = '1018'
> GROUP BY loc.location, loc.code, acc.desc;
>
> It is VERY rare that you cannot turn a derived table reference into a simple
> query or join. The most common case where you cannot is when you need to
> perform other operations on the results of an aggregation. In those cases,
> Informix provides temp tables, which is really how derived tables are
> implemented when they cannot be folded automatically by the engine into a
> simpler query (IDS 11.50 tries to do that for you).
>
> Art
>
> On Fri, Jun 20, 2008 at 9:57 AM, saad_tariq via DBMonster.com <
>
> u43...@uwe.iiug.org> wrote:
> > SELECT exp.*
> > FROM (SELECT loc.location, loc.code, acc.descr, count(loc.reqd_for)
> > AS
> > CountReqdfor
> > FROM informix.loc_accessorials loc, informix.accessorial acc
> > WHERE loc.code=acc.code AND loc.code = '1018'
> > GROUP BY loc.location, loc.code, acc.descr) exp
>
> --
> Art S. Kagel
> Oninit (www.oninit.com)
> IIUG Board of Directors (a...@iiug.org)
>
> Disclaimer: Please keep in mind that my own opinions are my own opinions and
> do not reflect on my employer, Oninit, the IIUG, nor any other organization
> with which I am associated either explicitly or implicitly. Neither do those
> opinions reflect those of other individuals affiliated with any entity with
> which I am affiliated nor those of the entities themselves.
I completely concur I think if you search for derived tables in this
news group I have several rants on the subject that should just be
referenced in the future. ;-)
Here is one:
http://groups.google.com/group/comp.databases.informix/browse_thread/thread/5fa50a300d9b6e59/e1d9624e38bf9a67?lnk=gst&q=derived+tables#e1d9624e38bf9a67