Subject | Re: [Firebird-general] Create View on Join Query on Firebird 2 |
---|---|
Author | Iwan Cahyadi Sugeng |
Post date | 2006-11-22T06:10:09Z |
Sorry about cross posting, but i don't know if this topic should be
technical or general.
As i know from MS SQL engine, it decide to use the first select query
column name. So i don't need to define each column name again for the
view
So this query:
CREATE VIEW UJIVIEW2 AS
SELECT ID,19 KODE FROM UJI
UNION
SELECT ID, KODE FROM UJI2;
will create view UJIVIEW2 with column name ID and KODE
and this query:
CREATE VIEW UJIVIEW2 AS
SELECT ID,19 NOMOR FROM UJI
UNION
SELECT ID, KODE FROM UJI2;
will create view UJIVIEW2 with column name ID and NOMOR
Well i wish it will be added for the next version. Thanks and sorry
again for wrong posting
Iwan CS
technical or general.
As i know from MS SQL engine, it decide to use the first select query
column name. So i don't need to define each column name again for the
view
So this query:
CREATE VIEW UJIVIEW2 AS
SELECT ID,19 KODE FROM UJI
UNION
SELECT ID, KODE FROM UJI2;
will create view UJIVIEW2 with column name ID and KODE
and this query:
CREATE VIEW UJIVIEW2 AS
SELECT ID,19 NOMOR FROM UJI
UNION
SELECT ID, KODE FROM UJI2;
will create view UJIVIEW2 with column name ID and NOMOR
Well i wish it will be added for the next version. Thanks and sorry
again for wrong posting
Iwan CS
On 11/22/06, Helen Borrie <helebor@...> wrote:
> At 04:57 PM 21/11/2006, Iwan Cahyadi Sugeng wrote:
> >Hi, i've tried Firebird 2 new feature to try out the improvement. It
> >is a great improvement i'd said, Congratulation to all the developer
> >team.
> >
> >But i've found some feature missing and actually don't know if someone
> >else agree with me.
> >
> >I've tried to create a view from a select query with union, it works
> >greater than before since it support union selection to create view.
> >But FB2 still need to define the column name for the view if the
> >select query did not select all field.
> >
> >What i want is:
> >
> >CREATE VIEW UJIVIEW2 AS
> >SELECT ID,19 KODE FROM UJI
> >UNION
> >SELECT ID, KODE FROM UJI2;
> >
> >and will show view with columns:
> >ID, KODE
>
> The improvements in views do not include breaking the syntax rules
> for defining views!
>
> Just as one thing (of many) to think about: according to your secret
> desire, consider what an SQL engine might do if the column names in
> the contributing SELECTs in the UNION do not match...which is
> perfectly valid for unions....
>
> This message slipped through to this list by mistake (mine). It
> should have been rejected. This list is *not* for technical
> questions. In future, would you please direct your support questions
> to the firebird-support list. Thanks.
>
> Helen (wearing Mail Admin hat)
>
>
>
>
--
Iwan Cahyadi Sugeng