Question: Computed properties on ember views have the form

```
myComputedProperty: function() {
    return doSomething();
}.property()

```

However, when I write this in coffescript as 

```
myComputedProperty: ->
    doSomething()
.property()

```

I get an error like "Parse error on line 5: Unexpected '.'". Am I doing something wrong, or is this a quirk of the interpreter I'm using (Mindscape VS plugin)?

Answer: 
If you are using 11g or later try

```
select * from table1
PIVOT  (SUM("COUNT")         
        FOR ("LOCATION","CATEGORY") IN 
        (('BLDG A',1) AS sum_a1,
         ('BLDG A',2) AS sum_a2,
         ('BLDG A',3) AS sum_a3,
        ('BLDG B',1) AS sum_b1,
        ('BLDG B',2) AS sum_b2,
        ('BLDG B',3) AS sum_b3));

```

[Here](http://www.sqlfiddle.com/#!4/a1905/18) is a fiddle

Otherwise use [APC's solution](https://stackoverflow.com/a/13082852/1083652)
The other answers will work great if you have a known number of values to transform into columns. But if you have an unknown number, then you can use dynamic sql to generate the results. 

You would create the following procedure:

```
CREATE OR REPLACE procedure test_dynamic_pivot(p_cursor in out sys_refcursor)
as
    sql_query varchar2(1000) := 'select empnum, empname';

    begin
        for x in (select distinct location, category from yourtable order by 1)
        loop
            sql_query := sql_query ||
              ' , sum(case when location = '''||x.location||''' and category='||x.category||' then cnt else 0 end) as sum_'||substr(x.location, -1, 1)||x.category;

                dbms_output.put_line(sql_query);
        end loop;

        sql_query := sql_query || ' from yourtable group by empnum, empname';

        open p_cursor for sql_query;
    end;
/

```

And then to execute it:

```
variable x refcursor
exec test_dynamic_pivot(:x)
print x

```

The result is the same as the hard-coded version:

```
| EMPNUM |   EMPNAME | SUM_A1 | SUM_A2 | SUM_A3 | SUM_B1 | SUM_B2 | SUM_B3 |
----------------------------------------------------------------------------
|    234 | EMILY DOE |      1 |      2 |      4 |      0 |     12 |      3 |
|    123 |  JOHN DOE |     11 |      4 |      7 |      1 |      3 |      0 |

```