Questions tagged as 'query'

0
answers

SQL - AVG with alias and vendor collation

I need to create a query that calculates the average of a vendor "score". Here is the query, and then the explanation of the fields: SELECT distinct C7_FILIAL, CASE WHEN C7_FILIAL = '0201' THEN '0201 - METAIS' WHEN C7_FILIAL = '...
asked by 07.11.2016 / 18:44
0
answers

Mysql query with dynamic columns

Friends have a question .... I have the following tables in Mysql: alunos (id, nome, etc) turmas (id, turma, etc) matricula (id, turmaID, alunoID) disciplinas (id, turmaID) avaliacoes (id, avaliacao) notas (id, matriculaID, disciplinaID, avali...
asked by 14.09.2016 / 01:11
2
answers

How to know if a database has already been made in the database?

How do I check if a given id has been registered in the database, and if you have not registered use an insert query and if you are already registered use an update query?     
asked by 02.10.2016 / 17:53
0
answers

Empty column record affects query time performance

Let's say I have a table with 4 columns and 4 records. Not all columns are filled at the time of the form because it is not mandatory, so the database has some gaps in its grid! Example: ID | Item1 | Item2 | Item3 --------------------------- 1...
asked by 04.09.2016 / 15:11
1
answer

PHP Fatal error: bytes exhausted After performing query laravel

Hello, in a given process of my code I need to execute a query that returns me 4500 rows from the database return Property::whereHas('portals', function ($query) { $query->where('portal_id', '=', '1'); })->get(); After exe...
asked by 26.08.2016 / 16:29
0
answers

Laravel 5 - Database table for array with predefined index

Is there any way to retrieve the results of a query in the database and transform it into an array with one of the fields of the indexed array table? You could achieve this result in two steps. After the query, it loops and transforms into th...
asked by 29.07.2016 / 23:16
1
answer

Concatenate SQL Server records

I have a problem in a query, where I need to concatenate records from a table. I need select to take the FormID and concatenate the records of AcaoID only if Permitir is 1. p> Query: Declare @Result varchar(...
asked by 28.06.2016 / 16:01
0
answers

Make SELECT display a certain value of a column last, keeping ordering by another column

I'm doing the following select in a database and displaying the result in a table in php: SELECT ID_PRDC, PRDC_ID_PRDT, PRDC_ID_SEM, DATA_PRDC, LINHA.NM_LN, PRODUTO.NM_PRDT, SEMI_ACABADO, NUM_OP, LOTE, QTD, PRDC_NUM_SEQ_LN, SITUACAO.DE...
asked by 22.07.2016 / 14:10
0
answers

Querying a record in SQLite

I am having a problem to perform a query in an SQLite database of an android application that I am studying. I can retrieve all records that the database contains, but I can not search for a single record in the table. It follows the code of the...
asked by 05.07.2016 / 12:02
1
answer

Oracle - From / to WebFocus to Oracle

Well, I'd like some help. I have an ETL that was created in WebFocus, and I'm going to migrate it to Oracle. I have already done a good part of the / paras, and would like an alternative to the following situations. In WebFocus, it can use...
asked by 17.10.2016 / 20:02