Data Comparison Single Table Question

Поиск
Список
Период
Сортировка
От Bryan Emrys
Тема Data Comparison Single Table Question
Дата
Msg-id 200804160634.27304.bryan.emrys@gmail.com
обсуждение исходный текст
Ответы Re: Data Comparison Single Table Question  (Osvaldo Rosario Kussama <osvaldo.kussama@gmail.com>)
Список pgsql-sql
I can handle this outside sql, but it seems like I should be able to do this in sql as well. 

1 table: countries. 
3 columns: id, name, price

What I'm trying to get is a result of the price differences between every country.

So if the data looks like (ignoring the id field)

Taiwain 30
UK 50
US 40

I'm trying to build a matrix that looks like:    Taiwan    UK    US
Taiwan    0        -20    -10
UK        20        0    10
US        10        -10    0

Any pointers would be appreciated.

Bryan


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

Предыдущее
От: Gerardo Herzig
Дата:
Сообщение: Re: Multiple databases
Следующее
От: Vivek Khera
Дата:
Сообщение: Re: How to find double entries