Обсуждение: Inheritance c.cities ??

Поиск
Список
Период
Сортировка

Inheritance c.cities ??

От
R Talbot
Дата:
Looking at the Postgresql manual in the inheritance section I see
abbreviations.

i.e.
SELECT c.name, c.altitude
FROM cities* c
WHERE c.altitude > 500;

c.name  of course refering to cities.name
 My question is where is there an alias reference of  c AS cities

How does and where does the  cities become c.  How does Postgresql
recognize the change.


bob T


Re: Inheritance c.cities ??

От
"Oliver Elphick"
Дата:
R Talbot wrote:
  >Looking at the Postgresql manual in the inheritance section I see
  >abbreviations.
  >
  >i.e.
  >SELECT c.name, c.altitude
  >FROM cities* c
  >WHERE c.altitude > 500;
  >
  >c.name  of course refering to cities.name
  > My question is where is there an alias reference of  c AS cities
  >
  >How does and where does the  cities become c.  How does Postgresql
  >recognize the change.

Here:

  >FROM cities* c

This is equivalent to "FROM cities* AS c".

In the current release, "cities" is equivalent to "cities*"; to get rows
from cities alone you need to use "FROM ONLY cities"

--
Oliver Elphick                                Oliver.Elphick@lfix.co.uk
Isle of Wight                              http://www.lfix.co.uk/oliver
PGP: 1024R/32B8FAA1: 97 EA 1D 47 72 3F 28 47  6B 7E 39 CC 56 E4 C1 47
GPG: 1024D/3E1D0C1C: CA12 09E0 E8D5 8870 5839  932A 614D 4C34 3E1D 0C1C
                 ========================================
     "Let the wicked forsake his way, and the unrighteous
      man his thoughts; and let him return unto the LORD,
      and He will have mercy upon him; and to our God, for
      he will abundantly pardon."          Isaiah 55:7



Re: Inheritance c.cities ??

От
"Thurstan R. McDougle"
Дата:
R Talbot wrote:
>
> Looking at the Postgresql manual in the inheritance section I see
> abbreviations.
>
> i.e.
> SELECT c.name, c.altitude
> FROM cities* c
> WHERE c.altitude > 500;
>
> c.name  of course refering to cities.name
>  My question is where is there an alias reference of  c AS cities
>
> How does and where does the  cities become c.  How does Postgresql
> recognize the change.


FROM cities* c is the same as
FROM cities* AS c
I personally would prefer it if everyone used the AS when it is implied
as, IMHO, it makes such statements much clearer.


>
> bob T
>
> ---------------------------(end of broadcast)---------------------------
> TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org

--
This is the identity that I use for NewsGroups. Email to
this will just sit there. If you wish to email me replace
the domain with knightpiesold . co . uk (no spaces).

Re: Inheritance c.cities ??

От
R Talbot
Дата:
R Talbot wrote:

> R Talbot wrote:
>
> > Looking at the Postgresql manual in the inheritance section I see
> > abbreviations.
> >
> > i.e.
> > SELECT c.name, c.altitude
> > FROM cities* c
> > WHERE c.altitude > 500;
> >
> > c.name  of course refering to cities.name
> >  My question is where is there an alias reference of  c AS cities
> >
> > How does and where does the  cities become c.  How does Postgresql
> > recognize the change.
> >
> > bob T
>
> Thank You
>
>  I answered my question..
>
> Bob T

Thank You

I answered my own question...

Bob T