Questions tagged as 'inner-join'

2
answers

Is it possible to use Inner Join in multiple columns of the same table in a Select?

There are 2 related tables in the database. Contributors : Events(hereyouentertrainingtimeperemployee): I need to know the total amount of training time for each industry. The Select below works, but only for column C1. I need to go...
asked by 08.11.2018 / 14:13
1
answer

InnerJoin with 3 tables Mysql [closed]

I am trying to make a query that when I type the name of a product, I return the sector code and the image associated with that sector but my innerjoin is not working I'm trying to do this: select ID_CORREDOR_PC, IMAGEM_PC, produto.NOME_PRO...
asked by 04.12.2018 / 22:42
1
answer

Perform two COUNT with INNER JOIN

By using the SQL below to count the number of brokers in a table using INNER JOIN , it works perfectly. SQL: SELECT conta.acesso, count(corretor.cod) as num_corr FROM conta INNER JOIN corretor ON conta.i...
asked by 13.07.2018 / 16:38
1
answer

INNER JOIN for more than one field in the same table

I have this INNER JOIN structure that works perfectly for what I needed so far. SELECT categorias.codigo,categorias.categoria,categorias.slug,empresas.cidade FROM categorias INNER JOIN empresas ON categorias.codigo = emp...
asked by 30.11.2018 / 17:27
0
answers

Use INNER JOIN with WHERE clauses

I'm reassembling a system before in ASP now in PHP already with database loaded and mounted, however I need to do some filters where I need to fetch data from at least 3 different tables and maybe more later (But I'll review this database becaus...
asked by 23.11.2018 / 15:12
1
answer

Intersection of same table, auto relationship, mysql with INNER JOIN

Hello, I'm doing a facebook clone database. I have two tables, one of users and another friendship. The friendships table is a self-relationship of users as shown in the picture. This Friendship table contains the IDs of each user and n...
asked by 24.10.2018 / 22:14
0
answers

mysql inner join with wildcard

I need to update on a table A by taking information from table B using inner join with wildcard to compare a snippet of content and if found in B, load a column in A. To just test this join I made the select below: SELECT vinhos.* FROM vinhos...
asked by 24.06.2018 / 21:00
1
answer

How to make an INNER JOIN in a single table with 3 keys?

I have a table that has the following structure: origem|papel|campo018|campo040|mercado|Master_key| The Master_key column can have two values: 'NY' OR 'MS' , I'd like to compare the rows in which Master_key is equal to...
asked by 19.06.2018 / 20:49
1
answer

Join two tables with PHP and retrieve the data in the same html select element

I am trying to list in the same element select of html the results of the query of different tables, but I am not getting. Here's the code below so someone can tell me where I'm wrong. <div class="form-group"> <label...
asked by 30.12.2018 / 15:27