Search Postgresql Archives

Create a table B with data coming from table A

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

 



My original table is like that:

ID	A1	A2	A3	cnt
1234	1	0	0	4
1234	1	0	1	8
1234	1	1	1	5
1235	1	0	0	6
1235	1	0	1	7
1235	1	1	1	12

I have to create a new table B:

ID	B1	B2	B3	S
1234	4	8	5	17
1235	6	7	12	25

The combination (A1=1,A2=0,A3=0) gives B1
The combination (A1=1,A2=0,A3=0) gives B2
The combination (A1=1,A2=1,A3=1) gives B3

S = B1+B2+B3

I think it's a classical problem, but i can't see to problem key

Thx,
Lhaj



[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