Questions tagged as 'query'

1
answer

Using CONCAT, CONCAT_WS, and GROUP_CONCAT

I'm building a query where I search for results within the concatenation and got enough to ask for help. I currently use MySQL with the PHP application. In the example below, I look for the words "F1000" and "GRID" in a concatenation of colum...
asked by 06.01.2017 / 12:52
2
answers

Using a select with UNION or another mysql parameter

I am developing cash flow from my company and am encountering a difficulty. I have two different tables. A table is tb_compras(id, fornecedor, nfe, valor, data) and then I have another table tb_compras_historico_pagamentos(id, id_co...
asked by 08.06.2018 / 19:21
2
answers

Group column sum by quarter

I would like to group the sum of one column per quarter, that is, every three months. I have the following query that groups from month to month: select month(data) as mes, year(data) as ano, ifnull(sum(det.quantidade),0) as total...
asked by 03.08.2015 / 15:39
2
answers

Is it possible to use native query + spring data to do pagination?

I need to do a paging using dynamic queries because I have to do many joins, I'm trying to make only a select * to test the use of the native query + spring data, but the error message is as follows: Cannot use native queries with dynami...
asked by 10.11.2017 / 16:50
1
answer

Tracking and posting system (social network type)

I am developing a new project and I am creating a system of profile followers, in which the purpose is to show only the publications of whom I follow. Like for example the one of a social network. I follow the person, so I get the person's publ...
asked by 13.12.2014 / 19:59
1
answer

Create Dto by the constructor with a List parameter of a Hibernate entity

I have a @Query Spring, which performs a query to the bank by an Entity, to create some DTO Objects. And the properties of this DTO object, I passed via Builder, but I needed to pass as a parameter on the List constructor it has in the Ent...
asked by 14.11.2014 / 20:52
1
answer

Retrieve last row inserted into table with non sequential primary key - MySql

Is it possible to know which last row was inserted into a MySql table where the primary key is not sequential? I have a table where the primary key is made up of two columns that are FK, so they do not follow a sequence. When executed the...
asked by 23.08.2016 / 16:08
1
answer

Shortcut to Ident Query Sql

Good afternoon everyone! Is there a keyboard shortcut that indentifies SQL Query and leaves the code organized? In the Database.Net application the command is Ctrl + M If anyone knows please let me know, today I work with SSMS and I use...
asked by 21.12.2018 / 17:00
1
answer

Convert LINQ to Dapper query

I have a LINQ query where I get the complete data. For performance reasons, I'm converting the query and using Dapper . I have the following entities: public class Cliente { public int ClienteId { get; set; } public strin...
asked by 28.06.2015 / 19:16
1
answer

How to get the last query executed by CakePHP?

I want to get the last query executed by CakePHP Example $data = $this->Ticket->find('all', array('conditions' => $conditions, 'order' => array('Ticket.id' => 'DESC'))); $this->query = $this->Ticket->getLa...
asked by 11.07.2014 / 23:41