Questions tagged as 'group-by'

1
answer

Two variables and one group by? PHP and MYSQL

I am making a very simple private (just between two people) chat system with PHP and MySQL, Jquery and HTML / CSS. In the database, the table has the following structure: id (int) remetente (varchar) destinatario (varchar) texto (text) horario...
asked by 16.01.2017 / 06:41
1
answer

Grouping of lines Group By

I have the following query: SELECT distinct CAPA.COD_HOLDING, CAPA.COD_MATRIZ, CAPA.COD_FILIAL, CAPA.ID_NF_ENTRADA, CAPA.NUM_NF, CAPA.DT_ENTRADA, CAPA.DT_EMISSAO, CAPA.COD_CLIFOR, CAPA.COD_UF, CAPA.CGC_CPF,...
asked by 04.01.2017 / 18:48
0
answers

Grouping SUMS by Date in PostgreSQL

I'm trying to get a total of the grouped requests by date as follows SELECT sum(pit.preco) AS preco, sum(pit.quantidade) AS quantidade FROM cliente c LEFT JOIN erp_pedido ped ON ped.id_cliente = c.id_cliente LEFT JOIN erp_pedido...
asked by 20.05.2016 / 18:45
0
answers

Selecting sets of JPA values

I have the following problem: I have a table with a list of values for a composite key. Here's an example: ID | ItemCode | Localidade | Preco ---+----------+------------+------- 01 | 001 | 001 | 3.5 02 | 002 | 001...
asked by 26.10.2015 / 19:09
0
answers

Referencing a group of ID's resulting from 'group_concat'

I have a select that returns the equally repeated lines, along with the total. I need to reference this group of ID's to pass as an argument. The result of my query is the array below. Basically it counts how many lines has Papa Charlie in...
asked by 29.07.2015 / 21:23
1
answer

How to merge files into folders, based on their prefixes?

I have thousands of files in hand that have common prefixes in their names, something like: [Prefix Example 1] ABC-1.mp4 ABC-2.mp4 ABC-3.mp4 [...] ABC-999.mp4 [Example 2 prefix] AAA-1.mp4 AAA-2.mp4 AAA-3.mp4 [...] A...
asked by 02.08.2015 / 16:36