dbTalk Databases Forums  

questions on crosstab/coss-referenced queries

comp.databases.postgresql.novice comp.databases.postgresql.novice


Discuss questions on crosstab/coss-referenced queries in the comp.databases.postgresql.novice forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
percy
 
Posts: n/a

Default questions on crosstab/coss-referenced queries - 05-26-2004 , 03:16 AM






hi list,

i have a table that is laid out like this:

student_id | tally | org_id
--------------+------------------
1 | 0 | 1
2 | 0 | 1
3 | 0 | 1
4 | 0 | 1
5 | 0 | 1
1 |8367220 | 2
3 |7561391 | 2
5 |2207271 | 2
4 |1280995 | 2
2 |1265355 | 2

and i want to lay the table like this:

student_id | 1 | 2
--------------+--------+--------
1 | 0 | 8367220
2 | 0 | 1265355
3 | 0 | 7561391
4 | 0 | 1280995
5 | 0 | 2207271

does postgres got a tool for queries like cross referencing/
crosstabs?

thanks,

percy

---------------------------(end of broadcast)---------------------------
TIP 9: the planner will ignore your desire to choose an index scan if your
joining column's datatypes do not match


Reply With Quote
  #2  
Old   
Nabil Sayegh
 
Posts: n/a

Default Re: questions on crosstab/coss-referenced queries - 05-26-2004 , 06:03 AM






percy wrote:
Quote:
does postgres got a tool for queries like cross referencing/
crosstabs?
Yes, it's in the contrib package.
e.g with debian:

apt-get install postgresql-contrib

HTH
--
e-Trolley Sayegh & John, Nabil Sayegh
Tel.: 0700 etrolley /// 0700 38765539
Fax.: +49 69 8299381-8
PGP : http://www.e-trolley.de

---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster



Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.