Re: Selecting pairs of numbers
От
Chris Mair
Тема
Re: Selecting pairs of numbers
Дата
Msg-id
bb61f220a0ba4aa1c42740957772ab0b@smtp.hushmail.com
Ответ на
Selecting pairs of numbers (Raymond O'Donnell)
Список
Дерево обсуждения
Selecting pairs of numbers Raymond O'Donnell <rod@iol.ie>
Re: Selecting pairs of numbers Adrian Klaver <adrian.klaver@aklaver.com>
Re: Selecting pairs of numbers "Charles Clavadetscher" <clavadetscher@swisspug.org>
Re: Selecting pairs of numbers Albe Laurenz <laurenz.albe@wien.gv.at>
Re: Selecting pairs of numbers Raymond O'Donnell <rod@iol.ie>
Re: Selecting pairs of numbers Adrian Klaver <adrian.klaver@aklaver.com>
Re: Selecting pairs of numbers Raymond O'Donnell <rod@iol.ie>
Re: Selecting pairs of numbers Adrian Klaver <adrian.klaver@aklaver.com>
Re: Selecting pairs of numbers Igor Neyman <ineyman@perceptron.com>
Re: Selecting pairs of numbers Chris Mair <chris@1006.org>
Re: Selecting pairs of numbers John McKown <john.archie.mckown@gmail.com>
Re: Selecting pairs of numbers Raymond O'Donnell <rod@iol.ie>
> I then might want to extract a list from, say, (1, 3) to (3, 2), giving: > > x | y > ----- > 1 | 3 > 1 | 4 > 2 | 1 > 2 | 2 > 2 | 3 > 2 | 4 > 3 | 1 > 3 | 2 > > For the life of me, I can't figure out how to do this. Hi, starting from this: chris=# select * from t order by x,y; x | y ---+--- 1 | 1 1 | 2 1 | 3 1 | 4 2 | 1 2 | 2 2 | 3 2 | 4 3 | 1 3 | 2 3 | 3 3 | 4 (12 rows) one trick that might help is this: chris=# select * from t where x*1000+y >= 1003 and x*1000+y <= 3002 order by x,y; x | y ---+--- 1 | 3 1 | 4 2 | 1 2 | 2 2 | 3 2 | 4 3 | 1 3 | 2 (8 rows) watch out, if you have y values bigger than 1000, though... Bye, chris.
В списке pgsql-general по дате отправления