sql - One to Many join returns single row in postgres -


i tried go through many pages not able find result problem. need solution below scenario, using left join needs enhancement.

for example:

click on link see example

one method conditional aggregation:

select pkid_from_table_1,        max(case when u_data = 'unique0' u_value end) unique0,        max(case when u_data = 'unique1' u_value end) unique1,        max(case when u_data = 'unique2' u_value end) unique2,        max(case when u_data = 'unique3' u_value end) unique3,        max(case when u_data = 'unique4' u_value end) unique4 example group pkid_from_table_1; 

this ansi standard sql , work in databases.


Comments

Popular posts from this blog

python - Operations inside variables -

Generic Map Parameter java -

arrays - What causes a java.lang.ArrayIndexOutOfBoundsException and how do I prevent it? -