Subject | Re: [firebird-support] Re: Could you help me with basic SELECT queries, please? |
---|---|
Author | Ann Harrison |
Post date | 2011-04-14T18:29:42Z |
2011/4/14 Ismael L. Donis GarcĂa <ismael@...>:
with
select <column list> from ThisTable t
The * is a handy thing in an interactive tool or a throw-away program
but one of the strengths of the relational model is separation of logical
and stored formats, leading to the ability to add columns to a table
and change column types. As soon as your application builds in
knowledge of the number of columns in a table you've blocked that
ability... unless you create a layer of views over the tables to preserve
the old formats, which begins to confuse the naming of things.
Good luck,
Ann
> Replace all:Actually, I'd suggest replacing the first version
>
> select * from table
>
> for
>
> select t.* from table t
>
with
select <column list> from ThisTable t
The * is a handy thing in an interactive tool or a throw-away program
but one of the strengths of the relational model is separation of logical
and stored formats, leading to the ability to add columns to a table
and change column types. As soon as your application builds in
knowledge of the number of columns in a table you've blocked that
ability... unless you create a layer of views over the tables to preserve
the old formats, which begins to confuse the naming of things.
Good luck,
Ann