Questions tagged as 'pivot'

1
answer

Change null values to '0' in a SQL pivot

I have something more or less like that select * from( selcect ...)as pt pivot( asc(valor) for desc in ( [Deporte y cultura],[Despensa],[Destajo - sueldo], [Destajos], etc ...) ) as pvt So far so good, but I get many results as null from...
asked by 19.09.2018 / 18:59
1
answer

How can I do a PIVOT with Dynamic columns?

I have a problem when generating a query using the PIVOT function of SQL - server 2008. The query itself has no disadvantages, since the values it throws are correct. For EMP3 the query throws totally NULL or 0, this is correct, but I need to ge...
asked by 04.11.2017 / 15:06
1
answer

Transpose data with 2 columns (PIVOT)

People, I appeal to you because google has not served me much for what I need. I'm looking for a way to perform a dynamic pivot with 2 columns. Example: I have this: id rut fecha entrada salida 2 15114999...
asked by 15.03.2018 / 22:00
0
answers

Problem when pivoting a dataframe from two concatenated dataframes

Use Python 3.5 and Pandas 0.20.3 I get an error when I try to pivot a panda dataframe which I obtained using the concat function. I detail the process. This is my first dataframe. df = pd.DataFrame([ ['2017-01-03 21:00:00','2017-01-03...
asked by 05.11.2017 / 10:51
4
answers

MySQL display records from one table as columns from another

I have a table articulos ------------------------- |id|descripcion|color | |--|-----------|--------| |1 |caja |rojo | |2 |baul |azul | |3 |cofre |amarillo| ------------------------- And another ta...
asked by 11.07.2017 / 18:32
1
answer

Problems with Pivot and Join SQL Server

Could someone tell me what I'm doing wrong? All the errors that mark me tell me the same thing    Expecting '(', or SELECT ( select distinct --periodo empleados.idempleado , conceptos.descripcion descripcion, valconceptos.valor, pe...
asked by 19.09.2018 / 02:31
2
answers

Laravel problem with pivot table

I have two tables: one for travel and another for clients. In the pivot table it relates to each other in ManyToMany. In the migration of the pivot table I have the following: <?php use Illuminate\Support\Facades\Schema; use Illuminate\...
asked by 04.12.2018 / 21:59
2
answers

Error converting nvarchar data type to date - SQL Server

I am generating a cross table where I show the operators and every day of the week with the number of tickets they attended per day, in this case I am creating a function that receives a date parameter and calculates each day of the week for so...
asked by 11.01.2017 / 00:54
1
answer

Problem with pivot SQL server 2008 r2

Good people, I have not touched much the issue of sql, at least to do what a client has asked me, you need to create a view where you see a single line with the days of a month that you enter a user of your application and show certain data....
asked by 14.11.2017 / 17:37
2
answers

Laravel soft delete in pivot tables

I have a m-n relationship between two tables using a pivot table. In the migration of the pivot table, I created it with a deleted_at field, using the softDeletes() method, like this: public function up() { Schema::cre...
asked by 29.12.2018 / 14:31