Questions tagged as 'sql'

2
answers

how to do a dynamic Stored Procedure picking up data from other database tables?

I'm in a social networking project with @RodrigoBorth , and we have the problem of How to index and update a user comparison system ... We were given the idea of working with Stored Procedure in MySQL and then I went back! I read about concep...
asked by 07.03.2014 / 13:57
3
answers

How to do NOT IN SQL?

I want to get all the pilots who have never performed flights on route 12345, already experimented with NOT IN and thus: SELECT pl.id FROM Piloto pl, Voo v, Rota r WHERE pl.id = v.id_comandante AND pl.id = v.id_c...
asked by 25.11.2015 / 15:41
1
answer

Left join with lambda GroupJoin and with condition

How can I make a left join with some conditions using LINQ lambda expressions? In SQL Server I have this query: select usr.Id, usr.FirstName, usr.LastName, ex.Id from User usr left join Exam ex on ex.Id = usr.IdExam and (ex.Id is...
asked by 11.02.2015 / 20:02
1
answer

Difference in use Unique and Unique Constraint index in Informix?

I would like to know what behavior / differences between a Unique Index and Unique Constraints for Informix ?     
asked by 21.12.2013 / 21:39
2
answers

BIT (1) versus TINYINT (1) for Boolean values

I may be wrong, but I get the impression that, in practice, the default in MySQL is to use columns of type TINYINT(1) to store boolean values, true / false or 0 / 1 . Only TINYINT accommodates up to 1 byt...
asked by 18.01.2016 / 13:33
2
answers

Report showing column index

I have a question for generating a report, I need it to get the data from an SQL table and instead the name of the precise table of its ID, below the data that the query generates COD_CLIENTE NOME ENDERECO CPF...
asked by 06.05.2015 / 20:21
3
answers

Convert rows to columns (Pivot?)

I have a table with 33 million phone records with the structure below: ccpf_cnpj ddd telefone tipo origem 11111111111 83 81021111 M SERASA 11111111111 83 87472222 M SERASA 11111111111 83 81023333 M TRANSUNION 11111111...
asked by 11.02.2016 / 13:05
3
answers

LEN function, know number of characters of a number

In the example below the result of the query instead of returning 7 is returned 5 . DECLARE @valor money = 10.6879 SELECT LEN(@Valor) The impression I get is that when the number is of type money , only 2 decimal places are con...
asked by 02.07.2018 / 20:54
1
answer

The name of the dt_ultimo_acesso column was not found in this ResultSet

I'm deploying a method by passing an id parameter: @RequestMapping(method = RequestMethod.GET, value = "/entidadesUsuario/{id}", produces = MediaType.APPLICATION_JSON_VALUE) public ResponseEntity<Collection<Usuarios>> buscarEnt...
asked by 20.10.2017 / 17:27
4
answers

How to improve SQL performance with IN clause?

I have this SQL here: SELECT id, nome, url FROM categorias WHERE status = 1 AND id_ls IN (SELECT id_categoria FROM cliente_categorias) GROUP BY url What it does is fetch only categories that have clients assigned to them. My categorie...
asked by 15.12.2017 / 20:35