Questions tagged as 'sql'

1
answer

Query does not return all registry data

The following query returns the correct record but missing items on its return. $nota = $this->Nota->find('first', [ 'conditions' => ['id' => $numero, 'serie' => $serie ] ]); For example: When no error, return...
asked by 19.12.2016 / 17:45
2
answers

Capture values from one table and insert them into another table

I have a temporary table that I fill in with the result of a given query. Now I need to go through the data of this temporary table, line by line, and pick certain fields and insert them into another table, and in that other table, generate a co...
asked by 19.12.2016 / 19:15
1
answer

Error: Expected End of Statement [closed]

I'm using SQL for a classic ASP page and in a part of the code I have this: If (opcao = 1) Then If credito > 0 Then SQL = "UPDATE FO_Passaportes SET creditoTotal = creditoTotal + " & credito & " WHERE...
asked by 26.06.2017 / 17:13
1
answer

Zend Framework - Where are query queries?

I have an application using Zend Framework, in structure MVC, I want to know where the query queries are made to the bank, I'm a little lost because I've never worked with Zend. In my model I instantiate, for example: class Cursos extends Zend...
asked by 31.10.2016 / 01:29
1
answer

How to do a SQL query (MySQL) with average and several INNER tables?

I have an SQL statement with 5 tables. Notice that in it I make up a radius calculation. I need to add a new table of ratings with: cod_avaliacao int (11) customer_code cod_provider decimal_value evaluation (10,0) Where the avaliac...
asked by 03.05.2017 / 22:01
1
answer

How to join the return of 8 query's into one?

I have 8 query's all have 5 unusual columns and some distinct columns,  Based on the common columns, can I display a single result of 8? Common Fields: F.CHAPA AS CHAPA, F.NOME AS NOME, F.FILIAL AS FILIAL, F.SECAO AS SEC...
asked by 25.10.2016 / 20:19
1
answer

JPA in java web

I'm having a project in JAVA WEB and I'm having problems with hibernate. The error is as follows: Informações: HCANN000001: Hibernate Commons Annotations {4.0.2.Final} Informações: HHH000412: Hibernate Core {4.2.2.Final} Informações: HHH...
asked by 22.10.2016 / 23:21
1
answer

MySQL doubt on Select

I have a table of chats in mysql , in it is the record of conversations between users. The fields are. id, id_from, id_to, message Example (My Data in DB): 1, 50, 10, 'Hello' 2, 10, 50, 'Nice?' 3, 50, 10, 'Yeah, And you?' 4, 10,...
asked by 06.11.2016 / 13:47
2
answers

Mysql Update filtering by expired date with x Days tolerance

I need to update only on records that are expired and adding a tolerance of x days Example                Tolerance of 5 days                Today is = 11/10/2016 id = 1 expiration = 10/10/2016 // just update if today was day 15 id =...
asked by 02.11.2016 / 22:32
1
answer

Relate tables to make customer recommendations?

I have a table "tanned", "commented" and "visited", every time a user likes, comments or visits a certain book on my page a record is inserted into the database for such: Tanned table: +----------------+-------------+ | id_livro | usu...
asked by 02.02.2017 / 19:14