order of clauses

Поиск
Список
Период
Сортировка
От Patrick Welche
Тема order of clauses
Дата
Msg-id 20010214221914.G17556@quartz.newn.cam.ac.uk
обсуждение исходный текст
Ответы Re: order of clauses  (Stephan Szabo <sszabo@megazone23.bigpanda.com>)
Re: order of clauses  (Michael Fork <mfork@toledolink.com>)
Re: order of clauses  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-general
create table vals (
  x float,
  y float
);
insert into vals values (2,4);
insert into vals values (2,2);
insert into vals values (2,1);
insert into vals values (2,0);
select x/y from vals where y>0 and x/y>1;

will give a divide by zero error as A=(y>0) and B=(x/y>1) can be evaluated in
any order (A and B = B and A). I obviously would like (y>0) to happen first,
but I don't see how this can be achieved.. Any ideas?

Cheers,

Patrick

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

Предыдущее
От: Dave Edmondson
Дата:
Сообщение: Postgres slowdown on large table joins
Следующее
От: "Mitch Vincent"
Дата:
Сообщение: Re: Postgres slowdown on large table joins