Questions tagged as 'query'

2
answers

Query with dynamic column spring data

I need to perform a select using the @Query of spring data, however I need to pass the column name by parameter Example: @Query("SELECT g FROM Grupo g where g.? = ?") Page<Grupo> findTeste(String campo, String valor); To call meth...
asked by 22.08.2016 / 14:37
1
answer

Mount Query for Last Record NoSQL Google Datastore

I'm working with Google's Datastore and I'm not getting a Query to get back what I need. Situation I have a Entity , with key pair {"item": codItem, "item": id} , still inside this Entity I have the property codCliente. Fo...
asked by 09.06.2017 / 15:39
1
answer

Problems with select in multiple tables

I'm trying to do the conversion from a select sql server to the Dapper, as it was too big, I'm wanting to make it leaner and readable ... But this error appearing in some parts SELECT email.assunto [Assunto], disp.cod_disparador [Dispa...
asked by 19.09.2016 / 17:46
1
answer

Hibernate Cache with select count

Hello I have a JPQL query, with count : public Long quantidadeFaturasAbertasAssinante(Integer idAssin){ return manager.createQuery("select count(f) from Fatura f where f.dataLiquidacao IS NULL and f.assinante.id = :ass", Long...
asked by 11.10.2016 / 21:06
2
answers

Which is more efficient, perform multiple queries or use JOIN?

I have a X table that has my user's data, and I need to return data related to that user to the Y and Z table to the client. I can do this using JOIN or: SELECT attr1, attr2 FROM Y WHERE X_id = id SELECT attr1, attr...
asked by 01.11.2017 / 14:54
2
answers

Fill in several combobox

I can fill a combobox with DataTable, but in my case I need to fill 2 combobox and 1 checkedboxlist with data from a MySQL bd //formulário cadastro private void frmCadastroRecibo_Load(object sender, EventArgs e) { Classes.DBconect con = ne...
asked by 11.12.2014 / 05:53
2
answers

how to do this query sql

code is PK in both tabela1: cliente codigo, nome, municipio tabela2: notafiscal codigo, numerodanota, cod_cliente I want to list a count (*) on all notafiscal where cod_client.municipality = 10 How do I run this sql?     
asked by 12.07.2017 / 21:45
2
answers

How to make a select in the bank to not bring repeated values?

For example you have in the table the values: green, red, blue, blue, pink, pink, pink, yellow. I would need to return from the table colors only once blue and pink. Do you have any way to do this?     
asked by 14.07.2015 / 19:33
3
answers

Multiple foreign keys in a single query

Well, I'm having some problems creating a mysql query that looks for several data from several tables in a single query, I looked here in the stack, I found some similar questions, but I could not understand the logic or method used, and or "why?...
asked by 26.07.2017 / 15:50
5
answers

Select last dates for each month SQL

I would like to perform a SQL to get a list of dates on the last day of each month. Example: From a list of 01/01/2016 until 12/31/2016 return the last days of each month: 1/31/2016, 2/28/2016 ... 12/31/2016. The database is in FileMaker....
asked by 03.10.2017 / 21:52