Expand * in pivot query
Posted: Tue 22 Apr 2014 03:36
Hi,
New user of SQLComplete, I'm testing it before trying to push it to my colleagues if it suits our needs (some of them currently using SQLPrompt).
Our data model requires a lot of pivoting, for example in the following query:
Am I doing something wrong, or can't '*' be expanded properly in this kind of situation?
If I TAB after *, SQLComplete expands to what follows rather than the pivoted columns:
It should be:
It's quite an issue as it renders the expanding useless as soon as I have pivots in my CTEs and so on.
Is there any plan to implement expanding for pivoted fields in a near future?
New user of SQLComplete, I'm testing it before trying to push it to my colleagues if it suits our needs (some of them currently using SQLPrompt).
Our data model requires a lot of pivoting, for example in the following query:
Code: Select all
select *
from
(
select c.SAMPLEID
,c.NAME
,c.VALUE
from CORPSAMPLEASSAY as c
where c.NAME in ('LOI_Total', 'MnO_Calc_pct', 'Tot_Chk')
) as t
pivot
(
avg(VALUE)
for NAME in (LOI_Total, MnO_Calc_pct, Tot_Chk)
) as pvt
If I TAB after *, SQLComplete expands to what follows rather than the pivoted columns:
Code: Select all
select t.SAMPLEID,t.NAME,t.VALUE
Code: Select all
select pvt.SAMPLEID, pvt.LOI_Total, pvt.MnO_Calc_pct, pvt.Tot_Chk
Is there any plan to implement expanding for pivoted fields in a near future?