Subject Re: [firebird-support] Re: sql query
Author David Johnson
Except that I can't type, and the second query should have been
"resolved_count" where it said "call_count", and I constructed the query
wrong ...

firebird doesn't seem to support the nested query syntax that i was
attempting to use.

Here is the corrected query, but it won't work in firebird.

select *
from (
select
CAST("Date_Time" AS DATE) as call_date
, count (*) as call_count
from CALLS
group by 1
) a

full join (
select
CAST("Date_Time" AS DATE) as resolved_date
, count (*) as resolved_count
from CALLS
where RESOLVED = 'Y'
group by 1
) b
on a.call_date = b.resolved_date





On Thu, 2005-02-24 at 16:44, markd_mms wrote:
>
>
>
> --- In firebird-support@yahoogroups.com, David Johnson
> <d_johnson@c...> wrote:
> > select
> > CAST("Date_Time" AS DATE) as call_date
> > count (*) as call_count
> > from CALLS a
> > where call_count > 0
> > full join
> > select
> > CAST("Date_Time" AS DATE) as call_date
> > count (*) as call_count
> > from CALLS b
> > where resolved_count > 0
> > on a.call_date = b.call_date
> >
> > I suspect that a full join is overkill, but it allows both for days
> that
> > you received no calls but resolved outstanding issues, and for days
> > where you received calls but resolved none (both are bad situations
> for
> > a helpdesk, but that is all the more reason to support them in your
> > management report).
> >
> >
>
> i tried that (with commas on the call_date line) but i get the
> following error when i try running the query
>
> Dynamic SQL Error.
> SQL error code = -104.
> Token unknown - line 6, char 1.
> full.
>
> any ideas?
>
>
>
>
>
>
> Yahoo! Groups Links
>
>
>
>
>
>
>