Re: Column aliases in WHERE clauses

Поиск
Список
Период
Сортировка
От Chris Travers
Тема Re: Column aliases in WHERE clauses
Дата
Msg-id CAKt_ZfvoNVVxyZTaHX0Zo0Q9kMQfuY_vWjt3dTraTNckTYj5YA@mail.gmail.com
обсуждение исходный текст
Ответ на Column aliases in WHERE clauses  (Eden Cardim <eden@insoli.de>)
Ответы Re: Column aliases in WHERE clauses  (Raymond O'Donnell <rod@iol.ie>)
Список pgsql-general


On Tue, Sep 18, 2012 at 2:53 AM, Eden Cardim <eden@insoli.de> wrote:
>>>>> "Craig" == Craig Ringer <ringerc@ringerc.id.au> writes:

    Craig> I just wish they hadn't written it backwards!

    Craig> It'd be much less confusing were it formulated as something
    Craig> like:

    Craig> SELECT FROM thetable WHERE first_letter > 'a' RESULTS
    Craig> left(value,1) AS first_letter

    Craig> or something, where the order is more obvious. I really
    Craig> dislike the way SQL is written not-quite-backwards.

It's not "written backwards", it's plain natural language semantics:
"give me the first letter of all records where the first letter is
greater than a". Refining a set is better done walking from the more
general set to a subset, not the other way around, IMO: "give me all
persons that are females and over the age of 20". Mathematical set
builder notation does this in a similar fashion, for the same reason.


Natural language semantics will get you into trouble though.  After all, I think Lisp follows natural language semantics remarkably closely if your natural language is Irish Gaelic....

Best Wishes,
Chris Travers

В списке pgsql-general по дате отправления:

Предыдущее
От: Guilherme Rodrigues
Дата:
Сообщение: Re: Change key primary for key foreign
Следующее
От: Edson Richter
Дата:
Сообщение: Re: Change key primary for key foreign