Questions tagged as 'query'

1
answer

Doubt how to query multiple tables with one word

I'm setting up a search system, where the user types in a search box any word, eg "Programmer", mysql will have to search that word in several fields in several tables, if by chance he finds that word in some place get back to me who is the prof...
asked by 27.09.2015 / 07:52
1
answer

I should not display negative results

I put a query where I bring some information, of which the last column returns positive, negative and zero values. I do not want to display the rows with negative values, but I'm not sure how to do that. This is Query SELECT C.SG_CONCESS...
asked by 31.07.2015 / 22:08
1
answer

Display foreign keys from a table in the query

I have a table where every projeto can be related to up to 4 produtos . Main table (foreign keys): IDPRODUTO IDPRODUTO2 IDPRODUTO3 IDPRODUTO4 Table produtos ID N...
asked by 15.04.2015 / 00:36
1
answer

How to find an item in a field separated by commas? [duplicate]

I have a field in a table with data separated by a comma: id_regioes: 1,2,3,4,5,6 . When I do the query "SELECT * FROM 'tb_operadora' WHERE 'id_regioes' = 1" , or "= 6" returns ok, but not when they are in 2,3,4,5. Eve...
asked by 23.03.2015 / 14:32
1
answer

IQueryable select data from multiple tables

I have a queryable linq to entities ) in the EntityFramework and I am not able to pull data from two or more tables. For example: var model = _service.List().Where(m => m.DS_GRUPO.Contains(searchString)).Select(m => new { m.PK_GRUPO,...
asked by 15.08.2014 / 21:49
1
answer

Problem - Linq SQL Server: Query unwanted in the database when assigning value in a derived field of the database

All right people I have the following problem: I have the method below that only has the job of updating a field in the database, the t_sap_log_jobs class that is passed as a parameter was created automatically when LINQ was configured....
asked by 31.07.2014 / 15:18
2
answers

How to do a SQL query with some blank criteria? [duplicate]

I'm creating a filter for a database search in a PHP application and obviously I have a lot of criteria, but I've only managed to work with only one criterion. Code: select codigo, despesa, data, estabelecimento, valor from financeiro whe...
asked by 19.07.2016 / 04:56
3
answers

IF condition within a WHERE - ORACLE PL / SQL

Here is the procedure with the problem: CREATE OR REPLACE PROCEDURE NOVODIA.PRC_PACIENTES_INATIVOS_95 ( --PARAMETROS IN_CPF IN VARCHAR2, IN_CARTAO IN VARCHAR2, OUT_CURSOR OUT SYS_REFCURSOR ) IS --VARIAVEIS V_COD_CLIEN...
asked by 24.04.2014 / 17:10
1
answer

Join with Active Codeigniter Record

I made a query that is running ok and I'm passing to the Codeigniter Active Record but it is not working because of a join that is a bit off with conventional, does anyone have any idea what it can be? $query = $this->db->query("...
asked by 11.06.2014 / 15:42
1
answer

JDBCTemplate RowMapper for Nested POJOs

Let's say I have the following Pojos public class Pedidos{ private Strig codigo; private String nomePedido; private List<Dados> dadosPedido; //getters e setters} } E public class Dados { private String nome; private...
asked by 27.02.2014 / 19:48