'Suiteql/NetSuite query Pivot

I'm fairly new to netsuite and was replicating a sql query to work for netsuite, I was able to replicate the entire query except for the last part that uses pivot.

The snippet of what I am trying is something like;

select * from (select item, price, pricelevelname from itemprice)t PIVOT( sum(price) FOR (pricelevelname) IN ([STOCKING DEALER], [VOLUME DEALER], [WHOLESALE]) as PVT

I am either getting a null_pivoted error or an internal error with any modifications i try, any help would be really appreciated.

Thanks!



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source