Questions tagged as 'group-by'

2
answers

Group by Day in Django

Does anyone have an example of a "bat-ready" grouping by date? I've tried all of this here ... Subscription.objects.extra(select={'day': 'date(created_at)'}).values('day').annotate(available=Count('created_at')) from django.db.models.aggregat...
asked by 22.01.2016 / 23:08
1
answer

GROUP BY and SUM in Crystal Report

I need to do something relatively simple with Crystal Report but I can not. I have a report like this: OP | CLIENTE | PREÇO 1 João 10 1 João 20 1 João 30 2 Marcelo...
asked by 05.12.2014 / 14:56
1
answer

Help with LinQ Method using group by Dynamic

I need to build a dynamic chart from a filter panel and two select fields that can be crossed. I already have the structure that goes to the graph and how I need to return from the backend . In the case of backend I have the code below t...
asked by 14.11.2018 / 20:10
1
answer

MYSQL - Latest results when grouping by a certain field

I have the following tables in my MYSQL database USERS Table id | login --------------- 1 | usuario1 2 | usuario2 3 | usuario3 STATUS Table id | idUsuario | data | status 1 | 1 | 2018-05-10 10:00:00 | a 2 |...
asked by 07.06.2018 / 21:58
1
answer

Grouping values in Django

I'm having a bit of trouble putting together some information, from separate models. For example: I have 3 models, one call Category , another call Group and another call Tools . These tables will get the name and slug o...
asked by 16.01.2018 / 19:26
1
answer

Group data from a Query?

I do a GROUP BY in a query result and the result comes like this: Iwouldliketoknowifitispossibletobringgroupedinthisway? I'd like to know if this collation is best done in PHP or Query and how can it be done? Follow my code: SQL...
asked by 22.05.2017 / 18:22
0
answers

SELECT in MYSQL grouped by month but showing all

I have the following table in MYSQL: cavalo - 2016-01-15 cachorro - 2016-01-16 gato - 2016-02-23 coelho - 2016-02-24 ovelha - 2016-03-21 tatu - 2016-03-22 I wanted to give a SELECT and show it this way: JANEIRO - 2016: cavalo cachorro FE...
asked by 29.01.2016 / 15:51
1
answer

From CTE in SQL for relational algebra

How to pass a CTE in SQL to relational algebra, such as: with publicacao_cte (nome,nr_publicacoes) AS ( select candidato.nome, Count(1) as nr_publicacoes from candidato, cv, ficha_inscricao, publicacao_cv where candidato.bi = ficha...
asked by 20.11.2015 / 18:53
0
answers

Problem with aggregate function, using CreateQuery from Hibernate

In a Packaging, a fk Packaging refers to the 'parent', the larger packaging. EX: let's say that inside a package B fit 10 packages A. A packing record A will have in your package the packing B in which it will be inserted. There is a query...
asked by 30.07.2015 / 21:42
2
answers

Error group by Oracle

When I try to do this group by in oracle it returns me message saying that this is not an expression group by SELECT produto.cd_produto, produto.ds_produto, est_pro.cd_estoque, estoque.ds_estoque, fornecedor.cd_fornecedor, forneced...
asked by 22.05.2015 / 17:06