Subject Handling aggregate in sub query bug in FB 1.5 rc 3
Author james_027
Handling aggregate in sub query bug.

I have mentioned that I was amazed on how the FB1.5 rc3 handles the
aggregate in sub query. Unfortunately I think it can't. I have
created a view like this and was able to compile it.

create view "requestsummary"

> ("RequestDate",

> "ItemID",

> "Qty",

> "Use",

> "Name",

> "Unit")

> as

> select "RequestDate", m."ItemID", sum(m."Qty") as "Qty",

> sum(m."Use") as "Use",

> (select "Name" from "items" d where d.ID = m."ItemID")
as "Name",

> (select "Unit2" from "items" d2 where d2.ID = m."ItemID")

> as "Unit"

> from "usage" m

> where "Status" != 'CAN'

> group by "RequestDate", "ItemID"

but when I try to use it by executing this statement "select * from
requestsummary". I always get an error message saying lost database
connection from the IB expert. In Delphi using IBO when Iam going to
prepare this satement "select * from "requestsummary" the same
message also appears. "Database connection Lost". And I actually have
lost my database connection.

I think this kind of query ins't allowed but by FB1.5 rc3 allowed me
to successfully compiled the view.


using executing this statemtn in FB1.5 rc3 is very successfull.

select "RequestDate", m."ItemID", sum(m."Qty") as "Qty",

> sum(m."Use") as "Use",

> (select "Name" from "items" d where d.ID = m."ItemID")
as "Name",

> (select "Unit2" from "items" d2 where d2.ID = m."ItemID")

> as "Unit"

> from "usage" m

> where "Status" != 'CAN'

> group by "RequestDate", "ItemID"


I wonder why? This is so strange. Another thing is that when I try to
compile again the view (the one I have successfully created.) it says
it has dependencies? But actually there is none. What I have to do is
to drop the view and create the same one.