Subject | Re: Column name for view select expression? |
---|---|
Author | Bill Oliver |
Post date | 2008-05-27T16:25:06Z |
With MySQL, at least, they auto name the columns...
mysql> CREATE VIEW V3 AS SELECT AVG(X), avg(x), avg(x) FROM T1;
Query OK, 0 rows affected (0.00 sec)
mysql> select * from v3;
+--------+---------------+-----------------+
| AVG(X) | My_exp_avg(x) | My_exp_1_avg(x) |
+--------+---------------+-----------------+
| NULL | NULL | NULL |
+--------+---------------+-----------------+
1 row in set (0.00 sec)
--- In firebird-support@yahoogroups.com, Dmitry Yemanov <dimitr@...>
wrote:
mysql> CREATE VIEW V3 AS SELECT AVG(X), avg(x), avg(x) FROM T1;
Query OK, 0 rows affected (0.00 sec)
mysql> select * from v3;
+--------+---------------+-----------------+
| AVG(X) | My_exp_avg(x) | My_exp_1_avg(x) |
+--------+---------------+-----------------+
| NULL | NULL | NULL |
+--------+---------------+-----------------+
1 row in set (0.00 sec)
--- In firebird-support@yahoogroups.com, Dmitry Yemanov <dimitr@...>
wrote:
>
> Bill Oliver wrote:
>
> > My co-worker wonders why we check this case? It seems that MySQL and
> > Oracle let you create the view fine.
>
> I'm wondering what name do they assign to the view column? X? AVG?
> Something auto-generated? What if the sample would be a bit more
> complicated, containing duplicated fields/expressions?
>
>
> Dmitry
>