Questions tagged as 'query'

1
answer

Mongodb query and return specific array elements within objects

Well, I need a help to query certain values in a document. I have a collection in the mongo that follows this structure, including this is the document I can get and find: link The find this easy I find document without problems using th...
asked by 06.01.2016 / 14:10
1
answer

createQuery (HQL) returns NullPointerException when trying to perform LEFT OUTER JOIN

Personal speech, I'm having a problem trying to run an HQL in my application. HQL is basically this: select c.id, c.solicitante from <mypackage>.Exame c LEFT OUTER JOIN <mypackage>.Profissional prof Java code: hql = "sel...
asked by 25.02.2016 / 19:38
1
answer

Search Query from a Dynamic Form (Codeigniter)

I'm having a problem building a QUERY that comes from a dynamic form. I have a search form in which the fields for search are dynamic (can be text or checkbox), that is, whenever a new field is added it must be possible to search for that fie...
asked by 10.11.2015 / 12:47
2
answers

Difficulty to Mount SQL Query with UNION with SUM

I have 2 tables that stores different sales type, and I need to add everything to get the value to generate the collection, but I'm not able to mount the sql query, as follows: SELECT CL.NOME,CL.id_cadastro_cliente, sum (L.VALOR_LANCAMENTO) a...
asked by 14.12.2015 / 20:19
1
answer

How do I retrieve the filters of a query?

Hello. Is it possible to find out which filters, computers, etc. were used in a query? Example: public class Program { class Produto { public int Id; public string Nome; public Produto(int id, string nome)...
asked by 06.10.2015 / 20:41
1
answer

Select two attributes from two different tables in a view

I have the model (superclass) Pessoa and the model Aluno public partial class Pessoa { public Pessoa() { this.Escola = new HashSet<Escola>(); } [Key] public int PessoaID { get; set; }...
asked by 24.08.2015 / 17:25
3
answers

Uncaught exception error PDOException with message 'SQLSTATE [HY000]: General error: 2014 [closed]

I have a code that works perfectly on the local server wampserver, it is a query interspersing the results the problem is that when I finish the site and host it I get an error. The code is this: $conn->exec('SET @orderA := 0; SET @order...
asked by 21.08.2015 / 03:04
1
answer

mysql error code 1111. invalid use of group function

I tried to use the following query in my database: SELECT MAX(COUNT(DISTINCT c.unique_carrier)) FROM companhia_aerea c, avioes4 a, ponte2 v WHERE c.unique_carrier = a.UniqueCarrier AND a.TailNumber = v.TailNumb AND V.DepDelay > 0; This q...
asked by 15.08.2015 / 15:53
2
answers

Get oldest value from another table

I need to create a query that returns the oldest stock of each product within a specified period: Tabela Produtos: ID DESCRICAO 1 TOMATE 2 ABACAXI Tabela Estoque: DATA HORA PRODUTO ESTOQUE 01/01/2015 09:01:00 1 8 01/01/...
asked by 12.10.2015 / 05:58
1
answer

I can not bring all records from the table

Hello, I'm not able to show all the records in a DB table row, I can only bring the first record. Here is my table: CREATE TABLE IF NOT EXISTS 'tbnoticiasrel' ( 'id' bigint(20) NOT NULL AUTO_INCREMENT, 'id_noticia' bigint(20) NOT NULL, 'id_...
asked by 27.07.2015 / 15:16