Questions tagged as 'query'

2
answers

Sequential numbering of the results of a query

I'm not very close to the database, and in fact I do not even need such functionality, but just for the sake of curiosity, it's possible to create in runtime , that is, during SELECT , a sequential numbering to be used in substitution of the au...
asked by 13.12.2014 / 18:07
3
answers

How can I split this INSERT in steps?

I have 70MIL records to insert into a table3 from table1 - 4 fields and table2 - 1 field . The following code does exactly what I need in the most optimized way a user has helped me build. INSERT INTO imagens3 (ID, IMOVEL, CODIGO, IMA...
asked by 19.01.2015 / 20:10
2
answers

Query in MySQL query

Query that I'm using SELECT os_id,os_data,os_processo,os_solicitante,os_tipo,os_cliente,os_empresa,os_adverso,os_local, os_comarca,os_advogado,os_preposto,os_documentos,os_status,login_nome, sum(osh.os_honorarios_valor) as honorario,sum(osh...
asked by 21.02.2018 / 02:03
3
answers

Grouping by day and date period

I have a query from the period from 26 to 30-06 which brings the following result: Data_Cancelado Cancelados 27-06-2017 4 29-06-2017 5 However, I want it to come this way, that is, I want it to come to the query...
asked by 18.08.2017 / 15:41
1
answer

Queries with multiple joins in ruby on rails

I want to do in ruby on rails, this: SELECT * FROM isolateds INNER JOIN genes ON geness.isolated_id = isolateds.id INNER JOIN stats ON stats.gene_id = genes.id INNER JOIN mutations ON stats.mutation_id = mutations.id When I do:...
asked by 17.04.2015 / 23:52
1
answer

How to search for similar words or synonyms in PostgreSQL

I need to make a search return similar words to me I found the phonetic search it can even be used to refine the search I need, but I do not think that is ideal. For example, in a database I have several professionals, but your professio...
asked by 26.05.2015 / 00:54
2
answers

How to convert Float to String using LINQ to entity?

How to convert Float to String using LINQ to entity? I need to convert a field from my database that has the float type to the string type in my C # using LINQ. Try using Convert.ToString, ChaveArquivo = Convert.ToString(n.scanIma.I...
asked by 22.09.2016 / 15:20
3
answers

How to do subquery with pdo

I would like to perform a subquery within this query: $ranking = $pdo->query("SELECT * FROM usuarios_emblemas GROUP BY usuario ORDER BY count(usuario) DESC LIMIT 3"); It would be to block the list of users with banned = true, ie I want t...
asked by 05.07.2017 / 19:13
3
answers

How to consult and return all the information about a product?

I have the following problem and will ask a question in a didactic way so that it can be useful to all the users that may need it. I want to make a SQL query that meets all the requirements and returns the values. The tbl_cor in thi...
asked by 26.11.2014 / 11:49
2
answers

How can I differentiate a 'NULL' string from a null fact value?

I made this example for you to understand how the query is done in the bank on my system. $sql = "SELECT * FROM tabela"; $result = $conn->query($sql); if ($result->num_rows > 0) { while($row = $result->fetch_assoc()) {...
asked by 23.10.2017 / 14:57