Search Postgresql Archives

Rows to columns query

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

 



Does anyone know if this is feasable

I have two tables

one has inv_id,amount,date, cheque no

the second has 
inv_id, amount , code (this relate to type of expenditure)

There is a one to many relationship on inv_id

What I want to do is 

Group all the fields in the first table (easy), but then have the
grouped values in the 2nd table appearing as values in the columns ie

inv_id, cheque, amount_vote1,amount_vote2,amount_vote3 etc

Is this doable/feasable (preferably in a view)

---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
      subscribe-nomail command to majordomo@postgresql.org so that your
      message can get through to the mailing list cleanly

[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