Questions tagged as 'group-by'

2
answers

Group records by column without the null value (Sql Server)

Dear friends, I have the following query: IF OBJECT_ID('TEMPDB..#TOTALHORAS') IS NOT NULL BEGIN DROP TABLE #TOTALHORAS; END SET LANGUAGE SPANISH; CREATE TABLE #TOTALHORAS( EMPLSECCION VARCHAR(100), EMPLMINUTOS VARCHAR(100), EMPLMINUTOSN...
asked by 16.11.2018 / 21:43
1
answer

SQL Server sum and distinct - Add once with repeated records

I have this table of expenses and I need to add the Total column. The problem is that the table takes into account the products, and when making the sum I added several times the total of a note (because in the same note there were seve...
asked by 24.04.2018 / 23:48
1
answer

SQL- If the rows add 1 in a group add the total

Good morning friends, I hope you can help me, I'm trying to make a query that depends on the category and if the sum of one column results in 1 the total is added. Any contribution can help me:) example |---------------------|--------...
asked by 08.02.2018 / 22:50
0
answers

Consult related tables (Many to Many), grouping results C # Linq Asp.Net MVC

I have a problem. I have 2 tables (Matricula and ValorAsistencia) that are related to an intermediate table "Assistances" (many to many). What I want is to make a query that shows me data of the first table, and then a column with the sum...
asked by 22.11.2018 / 23:42
2
answers

Get latest registered email - SQL

I ask you a question, I have a table of this type: Basically the user can have several emails. What I need to do is bring all the users, without repeating them and that the email that I bring is the last one registered. For example,...
asked by 16.08.2018 / 19:54
0
answers

DataFrame cell value grouped by 'groupby ()'

I have the following DataFrame of pandas that I call reacciones : Modelo Apoyo Grupo Fx Fy Fz 0 Reacciones 00 P1 G -1.0 0 162.0 1 Reacciones 00 P1 Q -3.0...
asked by 07.06.2018 / 13:59
0
answers

, how can I group, so that my data to get an average?

I have data of 6 months minute by minute but when doing the grouping and average, it generates data of 12 months, I only need the average of my 6 months, how can I correct grouping?     
asked by 23.04.2018 / 20:36
0
answers

dplyr function group_by error

I have a problem with the functions of the dplyr package. I want a data frame to be grouped in reference to several values (group_by), some fixed and others introduced by means of a vector. This vector would have variable dimensions. Once the da...
asked by 28.11.2017 / 13:54
1
answer

Query in tree with accounts by level

Good afternoon, I have a tabla that has clave , clave_padre , anio and nivel , and on the other hand I have a tabla2 that has the clave , cargo , abono , mes and anio . Wha...
asked by 14.06.2017 / 00:32