Search Postgresql Archives

How to count pairs?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Dear all,

I need to count all pairs of instances which occure under given ID number, e.g.:

ID word
-------------
1 car 1 fruit
2   car
2   fruit
2   vegetable
3   car
3   vegetable

And the output should be simillar to:

car fruit 2
car vegetable 2
fruit vegetable 1

Any suggestion how to do that in PgSQL? Thanks in advance for any pointers.

Cheers, Andrej


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux