Questions tagged as 'query'

1
answer

Query with date in variable in MySQL returning empty

I need to make a query in MySQL setting 3 variables, when I know in the case of integer number of the right one, more when I include data ta returning empty. Follow my query , what could be doing wrong? SET @tipo = 47; SET @dataini = 201...
asked by 04.05.2016 / 21:35
2
answers

How can I execute this query with Laravel 5?

How would I run the following query in Laravel 5: SELECT *, (SELECT COUNT('anuncios'.'cat-id') FROM 'anuncios' WHERE 'anuncios'.'cat-id'='categoria'.'cat-id') AS 'cat-total' FROM 'categoria' ORDER BY 'cat-nome' ASC     
asked by 23.03.2016 / 03:44
1
answer

SubQuery with Linq

I need to query Linq for an object called Client. This object has a relationship with another object, which is a List of phones. For each of the phones, there is a type: 'Casa', 'Comercial', 'Recado' , etc. I want to bring everything in...
asked by 15.02.2016 / 18:45
1
answer

Left outer Join does not have Null values [duplicate]

I have two tables: formulario_campo ( cod_campo, descricao, cod_formulario ) Filled with the following values - input_nome, Nome, 1 - input_sexo, Sexo, 1 The second table: — formulario_valor(cod_campo,valor,cd_oportunidade) In...
asked by 21.01.2016 / 14:40
1
answer

How to do a query with different table conditions

   REGISTRATION TABLE A        Attributes: Code, name, type       TABLE NUMBER B        Attributes: Code, number       TABLE C PERSONNEL        Attributes: Code, gender I need to bring the name and type information from table A with corr...
asked by 01.05.2015 / 03:43
1
answer

Doubt filter with linq, ASP NET MVC

I'm having a doubt on a filter using Linq, I have a critical object Within Critical has an ienumerable I need to return a list of critics that the status of the last moveocritica is equal to 2 But the code below is giving error var Criticas =...
asked by 05.03.2015 / 03:23
2
answers

Query to return only the highest values

I have the following table:    Contract | Privacy Policy | Year   13 7800 2015   12 7800 2014   12 7800 2013   12 7801 2016   12 7801 2013   12 5102 2017 I'm trying to do a query to return the result below, ie the biggest "year" for...
asked by 01.03.2015 / 20:52
1
answer

How to fill null with value from the previous line?

Looking at the following table, I want to fill in the value that is null with the value of the previous line, what is the best thing to do with mysql?     
asked by 21.10.2015 / 16:03
1
answer

Problem with SQL query assembly

I have a table of "disciplines", a table of "students" and a table "students Disciplines", where these students can be enrolled in one or more subjects. These disciplines are shown as checkboxes on the search screen to serve as filters. Now I ne...
asked by 08.06.2014 / 20:53
1
answer

How to do custom query with JPA + Hibernate

Hello, I would like to know an elegant way to make a custom query using JPA . Basically I want to run the query and return it to an object list, but usually it will be a query with N tables and only with the fields I will need. I und...
asked by 15.01.2015 / 18:59