Questions tagged as 'query'

1
answer

SQLite recursive query

I'm trying to query a SQLite database, I have the following tables: Table suggestions: CREATE TABLE IF NOT EXISTS sugestoes ( id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, texto VARCHAR(250), autor VARCHAR(250...
asked by 29.05.2018 / 04:19
1
answer

How to use NOT IN with data from another server in PHP

I've set up a table with Data that no should be fetched, I'll call it here Table . The data that was in this table are these: |Tabela_Not| Londres Tóquio Paris And I applied this Query to do searches by dropping the Table_Not ite...
asked by 23.02.2018 / 17:34
1
answer

How to add methods to a QuerySet?

I have a model defined in Django. I would like to add to this model a method that returns me part of a mounted query (a QuerySet ). That is, a method I want to define a method that affects the results of the query when calling Model.objects...
asked by 09.02.2018 / 13:15
1
answer

Problem in Query Builder Laravel

I am in doubt about a query with joins in my project, when running Select directly in the database I have no problems, but when building with Query Builder, I do not get results. Where would he be missing out on her set up? Normal Query:...
asked by 04.01.2018 / 01:34
1
answer

Assigning values to a numerical array of values a query in PHP

Given the marcas table of the teste_db database (for example) | id | marca | | 1 | mercedes| | 2 | audi | | 3 | fiat | | 4 | alfa | | ...| ... | |573 | ferrari | |574 | bentley | and given an array with...
asked by 07.12.2017 / 13:15
1
answer

Error executing oracle procedure

I have this procedure: CREATE OR REPLACE PROCEDURE buscaturma(cod in INTEGER) AS nomeT varchar2(20); BEGIN dbms_output.put_line('inicio'); IF (cod=0)then dbms_output.put_line('ZERO'); ELSE SELECT DS_TURMA into nomeT...
asked by 23.01.2018 / 14:30
1
answer

How to avoid performance problems with tables that contain lots of data?

I'm developing a payroll system, in which there is a 'problem' in one of your tables. For, to control the discounts in the pay of each employee, I thought of creating a table with the name: Discounts that would have the fields, such as: id,...
asked by 28.11.2017 / 15:54
1
answer

Example Query Count

Someone would have an example of how to do a COUNT in a query, separating the data by EstadoId (as an example). In my case I have several data in my bank, registered by several states, I need a query that counts. How many dat...
asked by 14.12.2017 / 14:55
2
answers

Join returning many records

Hello, I have already researched this error and I did not see any that fit my problem, so my problem is that I have two tables, I need to get some information from table B and insert it into the query next to table A, such as in table A I have i...
asked by 29.09.2017 / 14:20
1
answer

How to do inner join in associative table? [closed]

Tables and inserts: CREATE TABLE CLIENTE( IDCLIENTE INT PRIMARY KEY AUTO_INCREMENT, NOME VARCHAR(30) NOT NULL, SEXO ENUM('M','F') NOT NULL, ID_CARRO INT UNIQUE ); INSERT INTO CLIENTE VALUES (NULL,'GABRIEL','M',1); INSERT INTO CLIE...
asked by 19.09.2017 / 02:42