Subject | Re: [firebird-support] select count in view Firebird 2.5 |
---|---|
Author | Helen Borrie |
Post date | 2010-12-14T09:30:04Z |
At 10:20 PM 14/12/2010, raivis83 wrote:
/* as emp_count */ - it's not valid syntax for CREATE VIEW so I guess it's possible nobody has tested this, amongst all the changes that have been done for views DDL.
>Hi All!Try removing this:
>
>I have table and view, thats returning grouped field with the count of fields records in it.
>After upgrading from 2.1 to 2.5 I noticed that select count is returning null. Has anyone experienced anything like this and can confirm that it' s a bug and has reported it?
>
>Here is DDL:
>--------------------------------------------------------------------------------------
>-- Test table T_EMPLOYEE:
>SET SQL DIALECT 3;
>
>CREATE TABLE T_EMPLOYEE (
> ID INTEGER,
> NAME VARCHAR(20),
> DEPT_NO INTEGER
>);
>
>-- View
>SET SQL DIALECT 3;
>CREATE VIEW V_EMP_DEP(
> DEPT_NO,
> EMP_COUNT)
>AS
>select
> e.dept_no,
> (select count(*) from t_employee e1 where e1.dept_no = e.dept_no)
/* as emp_count */ - it's not valid syntax for CREATE VIEW so I guess it's possible nobody has tested this, amongst all the changes that have been done for views DDL.
> from t_employee e./heLen
> group by e.dept_no
>;