Questions tagged as 'join'

1
answer

How to return only unmatched records in a JOIN? [duplicate]

I have a question regarding the use of JOIN in SQL in this case: I have a produtos table and a destaques table that contains the id of the product. I need to make a query that returns only the records that are n...
asked by 17.10.2016 / 00:50
2
answers

how to query data in a table that is not related to another table?

I have the following tables: CREATE TABLE IF NOT EXISTS 'categoria' ( 'id' INT NOT NULL AUTO_INCREMENT, 'nome' VARCHAR(25) NOT NULL, 'descricao' VARCHAR(100) NULL, PRIMARY KEY ('id')) ENGINE = InnoDB; CREATE TABLE IF NOT EXISTS 'veicu...
asked by 22.11.2016 / 14:28
1
answer

Difference between INNER JOIN, JOIN and WHERE? [duplicate]

I need to make a query that returns information according to a given condition, I've always used Where because I did not know if I could use another method. So what's the difference between Where , Inner Join and...
asked by 20.10.2017 / 17:40
3
answers

How to perform a select by multiple fk?

I have a question about one (or more) select . I have the following bank set up and I need to do a search for a particular recipe based on one (or more, and oh, that's the problem) ingredients. How do I get the recipe that contains all the...
asked by 23.03.2018 / 04:55
3
answers

Relationship between tables

I have the following tables: TB_ESTOQUE |COD_PRODUTO|QT_DISPONIVEL|COD_FILIAL| | 0856322 | 5 | 41 | | 0856351 | 2 | 41 | | 0856322 | 9 | 114 | | 0856720 | 3 | 20 | | 08563...
asked by 09.10.2018 / 16:41
3
answers

How is the join and WHERE with multiple tables made?

I have 4 tables they already have foreign key. aluno: id matricula username curso_id // referencia a id_cursos da tabela cursos, coluna id_cursos. cursos: id_cursos nome_cursos modulos: id_modulos nome_modulos cursos_id...
asked by 04.11.2017 / 14:57
2
answers

Display zero in group by SQL Server

I have a table that calls Ordem , it has a field that represents the Status of the service order (0 to 7), I need to plot a graph in Ireport, but I wanted to display in the caption the name of the status when the value is zero. The sele...
asked by 17.08.2015 / 15:26
1
answer

Doubt mySQL and Left Join

I have the following SQL, which returns data that will fill some inputs of a form. The problem is that I have 20 items (pieces) in this table, but it can be empty because the user can fill any amount. The description of the piece is in her table...
asked by 07.03.2016 / 18:30
1
answer

How to improve the performance of this SQL query?

Hello, I'll first pass some pertinent data to the query. Tabela Contrato (id, id_cliente, status [ativo/inativo]) Tabela Cliente (id, nome) Tabela Dependente (id, id_cliente, nome, status [ativo/inativo]) Tabela Cartao (id, id_cliente, id_depe...
asked by 09.03.2015 / 06:00
1
answer

FULL OUTER JOIN generates errors

I'm trying to run the following MySQL script SELECT 'AccessDayClass'.'total' AS 'em aula', 'AccessDayNotClass'.'total' AS 'em casa', 'AccessDayClass'.'DateOnly' AS 'week' FROM 'AccessDayNotClass' FULL OUTER JOIN 'AccessDayClass' ON 'Ac...
asked by 19.06.2018 / 00:31