Questions tagged as 'query'

1
answer

Remove duplicate records from a table

Having the following tables without keys yet defined: Airplane (code_auto, company_code, year, motor_type, type, state) Flight (FlightCode, FlightNumber, flightCode, CompanyCode) In some cases, about 400 records from the airplane table,...
asked by 17.09.2015 / 13:44
1
answer

query optimization that adds values according to a clause

Hi. I have a query that should bring two columns, one of the columns will return the value of one column, plus the sum of another column respecting the where clause to add the values. I came to find the result that serves me as follows:...
asked by 03.08.2015 / 17:22
2
answers

SQL Query, join 4 tables, 2 group_concats + conditionals, Help

Hello, I have created a query sql to return all client data in a single query, this query works partially if all conditionals are satisfied, but this system uses soft delete, in which all the records can not be deleted and only marked as inactive...
asked by 01.07.2015 / 14:27
1
answer

Query ordering - sql server

I need to sort my query so that the column "CenterNameConsolidation" conforms to the logic applied in the column "AllNormal" could anyone help me please? WITH CentroNiveis AS ( SELECT cen.Id,...
asked by 16.04.2015 / 00:56
1
answer

Linq does not return data. There is data in the table and I return by query

I tried to make a LINQ very similar to my query. This is my query. select * from PDV where tipo_PDV = 'R' and UF = 'DF' and Cidade = 'BRASILIA-DF' This is my LINQ var resultado_rede_descricao = (from _pdv in db.PDV...
asked by 02.10.2014 / 13:56
1
answer

How to do a random search using JPQL script in JPA2

The idea is basically to look for an X number of persisted entities in a random way, and these entities can not be repeated. The question is, can you perform this type of search by creating and executing a JPQL script ?, or is it necessary to im...
asked by 02.10.2014 / 16:23
2
answers

I am having difficulty returning my ID using nextval, to later insert it into my table

I'm having trouble returning my ID using nextval, and then inserting it into my table OleDbConnection cnx = new OleDbConnection(new AdministradorDAO().conexao); cnx.Open(); string seq = ("select id_usuarios.nextval from dual");...
asked by 16.09.2014 / 14:21
1
answer

get number of results of a query with the bank using cakephp

I want to loop to display the results of a database query, and get the number of results found in the query. I'm using cakephp. Does it have any function that does the same thing as mysqli_num_rows ?     
asked by 22.12.2014 / 19:33
1
answer

How to make requests to Core Data to get only one attribute?

I only need to get an attribute from a single row of the table: name | id | idade | aprov|repro| sala | _______|______|________|______|_____|______| John | 32 | 15 | A | | 155 | Following the table above, it would be...
asked by 28.10.2014 / 16:12
1
answer

How to get the contents of the condition of the JOIN clause

I have the following situation that can be seen in this link . The expression is: /((^|\s)(right|inner|left)\sjoin\s(.*?)on\s(.*?)(?=(inner|right|where)?))+/gmi I need to get the conditions that are within on , plus the other info...
asked by 09.04.2014 / 14:36