Re: [SQL] Subquery problems

2007-06-22 Thread Masaru Sugawara
> > Original Message ---- > Subject: Re:[SQL] Subquery problems > From: Masaru Sugawara <[EMAIL PROTECTED]> > To: Ranieri Mazili <[EMAIL PROTECTED]> > Date: 21/6/2007 13:25 > > On Tue, 19 Jun 2007 09:17:22 -0300 > > Ranieri Mazili <[EMAIL PROTECTED]&g

Re: [SQL] Subquery problems

2007-06-21 Thread Masaru Sugawara
On Tue, 19 Jun 2007 09:17:22 -0300 Ranieri Mazili <[EMAIL PROTECTED]> wrote: Hi, This reply is not accurate, but I think there are helpful hints. -- Masaru Sugawara select C.id_production_area, B.id_machine_type, A.h_month as month, max(A.n) as div_mes, cast((sum(A.qty_employees_t

[SQL] Subquery problems

2007-06-19 Thread Ranieri Mazili
Hello, I'm having another "problem", I have a function that declares 12 variable, one per month and each them execute a select like bellow: *DIV_MES01 := (select count(distinct production_date) from production where extract(month from production_date) = '01' and extract(year from production_da