|
|||||||
|
|
|
![]() |
|
|
Strumenti |
|
|
#1 |
|
Member
Iscritto dal: Jul 2002
Messaggi: 230
|
[php+MSSQL] campi in tabella pivot
Ciao a tutti ho un problema con una query in tabella pivot,
Codice:
DECLARE @columns VARCHAR(8000)
SELECT @columns = COALESCE(@columns + ',[' + cast([descrizione] as varchar) + ']',
'[' + cast([descrizione] as varchar)+ ']')
FROM abbinamenti_pivot
where id_stagione = 18
and cod_gruppo = 31
GROUP BY [descrizione]
DECLARE @query VARCHAR(8000)
SET @query = '
SELECT *
FROM abbinamenti_pivot
PIVOT
(
MAX(cod_tex)
FOR [descrizione]
IN (' + @columns + ')
)
AS p
wherestagione = 18
and cod_gruppo = 31 '
EXECUTE(@query)
|
|
|
|
|
| Strumenti | |
|
|
Tutti gli orari sono GMT +1. Ora sono le: 05:14.


















