Questions tagged as 'join'

2
answers

Select with INNER JOIN, bringing fields that have foreign key NULL

I have a table of items, request_itens, interested (it has auto relationship, it is used for secretary, sector and employee, and a requested table), in the order table I have 3 foreign keys (one for secretariat, another for sector and one more f...
asked by 27.05.2016 / 23:21
3
answers

Problems with SELECT RIGHT JOIN

I have two tables, A and B. In Table A, I have a column with machine names (Cortadeira, Baler, Packer and Rewinder) and in the other column some causes that made them stop Lack of Electric Power, Coil Replacement, etc). In Table B , I have a...
asked by 07.03.2018 / 12:29
1
answer

Select with Inner join too slow

I have a problem where select is bringing the right result, but it takes too long. Follow the select: SELECT c.cod_paciente, p.nome, i.valor, i.quantidade, d.convenio, c.cod_conta FROM caddadosclinico d INNER...
asked by 05.01.2018 / 20:26
1
answer

INNER JOIN with where

I have the following tables: permissoes_users id_user id_permission permissions  id  - Permission I have a session variable where I have the id di user, I need to search the table for the id and those that have the id of the user to...
asked by 19.11.2015 / 12:51
1
answer

Get data from fields of the same name but from different tables

I have a select that it fetches data from three different tables, but has some fields in common between these three tables. My question is how to get the data from this field, which has the name in common with the other tables. My select look...
asked by 10.12.2014 / 14:32
2
answers

Correct way to make a large inner join

Good day, people. I'm a beginner in php and I'm developing a program for file box control. I have a database in which the "box" table is the main one, it has several references to other tables. Here's how: <br>CREATE TABLE 'caixa' (<b...
asked by 10.06.2016 / 15:40
1
answer

Table query with CONCAT and JOIN?

I need to get a collection as a result of querying in 3 tables using concat and join , the image below shows the relationship between them:    Itriedtousethecodebelow$teste=DB::table('clientesasc')->leftjoin('reservas...
asked by 10.07.2018 / 13:49
1
answer

Join in the database

I'm developing software where the user selects the items in his house, selects how long he does not clean them, and at the end he fills out a form to receive an e-mail discount and clean the items. All this data goes to the bank. However,whendo...
asked by 26.10.2017 / 18:28
1
answer

What is the difference between the various types of SQL JOIN? [duplicate]

In SQL there are several types of JOIN , what is the difference between INNER JOIN , LEFT JOIN , CROSS JOIN , RIGHT JOIN and FULL JOIN ?     
asked by 20.09.2016 / 03:25
4
answers

How to bring records of a LEFT JOIN even if it does not obey WHERE?

For example, I have tabela_A : cod nome 1 stack 2 overflow 3 stackoverflow and tabela_B : cod_tabela_A ano mes valor 1 2016 1 100 1 2016 2 115 2...
asked by 04.03.2016 / 17:42