Questions tagged as 'join'

1
answer

How to use a join clause by adding a column indicating the existence of a link

I have two tables Horas (id, aluno_id, atividade_id) and Atividades (id, emblema_id) In addition to returning all the badges, I need to return a column that tells me if that student owns it. To know if he has, it is enough that he has...
asked by 16.02.2018 / 13:05
3
answers

Get the same result as a query with join

I have already researched some forums, looked at my books and searched other sources, but I did not find anything that solved my problem. I have a query that queries the open value in a given table: select negociacao_parcela.data_pagamento,...
asked by 22.01.2018 / 20:41
1
answer

How to Join with Sum and Group By

I'm trying to do a SQL query using Join between two tables. The first table is a table that contains monthly savings values for a given project. Each time someone registers a project on the site, a PHP routine generates 12 values, one in the cur...
asked by 24.01.2018 / 22:27
4
answers

What is the difference between INNER JOIN and OUTER JOIN?

What is the difference between INNER JOIN and OUTER JOIN ? Can you give me some examples?     
asked by 19.02.2014 / 03:32
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
1
answer

Join between tables that are not directly related

I have three tables: Candidate that has an ID as pk (which was invented) Application that has FK for Candidate ENEM that does not have any id that represents the candidate, only his / her registration and information such as color / race...
asked by 18.09.2017 / 03:54
1
answer

Node.js - Aggregate object returns

I'm locally doing the Node.js exercise as MongoDB proposed at link There are two collections, orders and product . After aggregation, the expected result would be: [ { _id: 1, product_id: 154, status: 1, orderdetails: [ { _id:...
asked by 09.09.2017 / 02:52
1
answer

I can not join data - it must be INNER JOIN

I have two tables, tab_prefixo has number of prefixo and gerente responsible (important data), and in the other one (table tab_valores ), it also displays prefixo , nome , valor and data . I...
asked by 10.08.2017 / 03:46
1
answer

Select connecting 3 tables in Firebird with different IDs

Good afternoon, I need to make a select that returns the description of the product, barcode and price . The description and price are in one table (TB_ESTOQUE) and the barcode is in another (TB_EST_PRODUCT). However, the IDs of th...
asked by 07.07.2017 / 21:48
0
answers

Avoid a Cartesian plane in a join with 2 tables with duplicates

According to the image above: The A1 field of TableA has two duplicate values which is key 3 and TableB with the B1 field has the same duplicate values. I wanted to make a inner join between the two...
asked by 07.07.2017 / 23:55