Informix-Create View bring informix server down
Posted in 1999
Topics: SQL Development & Query Writing
Hi; I'm trying to create a view, which can provide me a subscriber count, dep
count . It is not possible to get those count in one select statment, so I
include a subquery.
SQL :
Create View MbrCount (group_id,plan_id,sub,dep) AS
Select distinct a.group_id,a.plan_id,count(a.member_id) sub,
(Select count(distinct c.member_id)
From b,outer c
Where
a.group_id = b.group_id
and a.plan_id = b.plan_id
and b.mb_gr_pl_id = c.mb_gr_pl_id
and b.member_id <> c.member_id
and c.eff_date <= today
and (c.exp_date is null or c.exp_date > today)
group by b.group_id,b.plan_id )
From a
Where a.eff_gr_pl <= today
and (a.exp_gr_pl > today or a.exp_gr_pl is null)
Group by a.group_id,a.plan_id
When I run this query, it bring the server down. But when I just run as a
query [without create view statment] it run prefect.
What am I doing wrong???????
thanks in advance
Rahim
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own