From: | "Jan Cruz" <malebug(at)gmail(dot)com> |
---|---|
To: | "Qingqing Zhou" <zhouqq(at)cs(dot)toronto(dot)edu> |
Cc: | pgsql-bugs(at)postgresql(dot)org |
Subject: | Re: statement stuck when the connection grew up to 45 or more |
Date: | 2006-06-02 07:08:58 |
Message-ID: | 493da2780606020008w541f6676n69818d826cf30dc5@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-bugs |
This is the statement which having problem:
select count(distinct empno) as counter1 from pay_master_history
where empno in (select empno from pay_batch_basic_history where
organizationid like '015003%')
and processyear = '2006'
and processmonth = '05'
and processbatch = '1'
SELECT COUNT (*) FROM (
SELECT empno as counter1 from pay_master_history as a
INNER JOIN (select empno from pay_batch_basic_history where organizationid
like '015003%' and processyear = '2006'
and processmonth = '05'
and processbatch = '1') as b
ON b.empno = a.empno ) as count_result
-----------------------------
or just create the view and use inner join then count :b
From | Date | Subject | |
---|---|---|---|
Next Message | Magnus Hagander | 2006-06-02 08:48:43 | Re: Infinite increment of postgre.exe in taskmanager |
Previous Message | Stefan van Aalst | 2006-06-02 06:29:00 | Infinite increment of postgre.exe in taskmanager |