Subject | Re: [firebird-support] need some script help (newbie) |
---|---|
Author | Lucas Franzen |
Post date | 2004-03-02T09:23:08Z |
Iip Umar Rifai schrieb:
do a select group by on the View.
Like:
CREATE VIEW VIEW_COUNT_A ( TYPE, A_COUNT )
AS ( SELECT TYPE, COUNT(*) FROM A GROUP BY TYPE )
and query that view with:
SELECT A_COUNT, COUNT (*) FROM VIEW_COUNT_A
GROUP BY A_COUNT
Luc.
> Hi All,I think the easisest way is to certate a view that represents B and then
>
> Could you help me how to get column with contain like an example below using sql
> command;
>
> A.data :
> type name
> A Atype
> B Btype
> C Ctype
> A Atype
> D Dtype
> B BType
> E Etype
>
> B.Result :
> type count
> A 2
> B 2
> C 1
> D 1
> E 1
>
> C.Result :
> count Total
> 2 2
> 1 3
do a select group by on the View.
Like:
CREATE VIEW VIEW_COUNT_A ( TYPE, A_COUNT )
AS ( SELECT TYPE, COUNT(*) FROM A GROUP BY TYPE )
and query that view with:
SELECT A_COUNT, COUNT (*) FROM VIEW_COUNT_A
GROUP BY A_COUNT
Luc.