Questions tagged as 'pivot'

1
answer

Python dynamic tables

I receive a report with this data every day: ALL the values of the headers can change although the Dates field is always going to stay the same for each client, to which I refer: What I need is that in my file called Data.xlsx...
asked by 21.12.2017 / 13:40
1
answer

Clause CASE in PIVOT? SQL Server 2008 r2

Good people, I have this query with a pivot that gives me this data: DECLARE @cols AS NVARCHAR(MAX), @query AS NVARCHAR(MAX), @date1 AS NVARCHAR(MAX), @date2 AS NVARCHAR(MAX), @space NVARCHAR (10), @x NVARCHAR (10)...
asked by 16.11.2017 / 15:00
1
answer

Convert Row to Column SQL server query

Good morning, I need to transpose or change the result of a table in the following way: The structure of the table is 5 columns (description of users, permission1, permission2, permission3, permission4) the description field is varchar...
asked by 31.08.2017 / 19:01
2
answers

Convert columns into rows with PIVOT

I have the following query: SELECT COUNT(*) 'Impartidas', DAY(kh.Hora) AS 'Dia' FROM K_Horario kh WHERE CONVERT (char(10),kh.Hora,20) BETWEEN '2017-07-03' AND '2017-07-09' GROUP BY DAY(kh.Hora) ORDER BY DAY(kh.Hora) And it returns the follo...
asked by 15.08.2017 / 21:09
0
answers

Pivot with Oracle

In this query, day is a date field, effort a numerical field where I keep the number of hours worked and technical, as the name of the technician. I want to get the hours for each month from each technician. select * from ( select to_char(dia...
asked by 20.12.2018 / 14:44
0
answers

SQL pivot, concatenate during the pivot

I'm trying to concatenate the data after the pivot select [ARC_ID] from (select [MTD_ID],[ARC_ID],[MET_ARC_VALOR] from [dbo].[TB_BGP_METADATA_ARCHIVO]) as SourceTable pivot(MAX([MET_ARC_VALOR]) for [MTD_ID] in([1],[2],[3],[4],[5],[6])) as P...
asked by 09.07.2018 / 23:24
0
answers

query with sql pivot

I have this query but I like to add the number of calls and the sum TMO per hour example so I want to do it: usuario 8 9 10 cantidad|tmo cantidad|tmo cantidad|tmo juan 20 | 45.20 20 | 10.3 52...
asked by 26.05.2018 / 01:34
0
answers

Update data in pivot table ADF

I have a Pivot Table ADF (work with JDeveloper 12c), where in the columns I have grades and rows, subjects. The idea is to select one of those notes and edit it in the same pivot table. The pivot table is like this: I hope the questions...
asked by 28.02.2018 / 12:59
1
answer

pass rows to columns

I wanted to see if you can help me with this.    My query is as follows: select O.idgoOperacion [Operacion] ,uuu.Etiqueta ,uuu.Valor from Operacion O docDocumentoArchivo Doa on doc.iddocDocumento = Doa.iddocDocumento [dbo...
asked by 11.01.2018 / 20:39
1
answer

Dynamic Columns - SQL Server 2012

I have two tables which I want using a Query SQL Server to generate dynamic columns depending on the number of records in a table. Please see the image.     
asked by 03.11.2017 / 03:34