Questions tagged as 'join'

1
answer

Sort result of a query with JOIN based on the number of records of one of the tables

Assuming I have two tables in my database ( pedidos and pedidos_itens ) how can I get the data from the orders sorted by the orders that contain the most items? I have tried to do a Right Join , but I do not know what to use i...
asked by 17.11.2016 / 13:07
3
answers

How can I display data using JOIN?

I am making a section on my site called "My Ideal Surfboard", in it the user inserts his data (weight, height, etc), a comparison is done in the database ( join ) and is returned to the user type of the ideal board according to his profile...
asked by 15.06.2016 / 19:45
3
answers

Relationship of tables

Good Night, I have a database with several tables and I need to do a query relationship 4 tables CREATE TABLE IF NOT EXISTS 'cad_cliente' ( 'id_cliente' smallint(5) unsigned NOT NULL, 'nome_cliente' varchar(45) NOT NULL, 'nom...
asked by 06.07.2015 / 23:00
1
answer

Problem with LEFT JOINs joins and a condition [closed]

I have had this problem for some time now. I am counting on your help. I have 3 tables: publicacao id cartaz titulo 1 eradogelo.jpg A Era do gelo 2 ojogo.jpg O Jogo 3 helpme.jpg Help Me 4 please.jpg Pleas...
asked by 27.01.2015 / 20:20
1
answer

Data being repeated when using INNER JOIN in Oracle

I have three tables, which are as follows: ALUNO , CLASSE and MATRICULA . STUDENT NR_RGM NM_NOME NM_PAI NM_MAE DT_NASCIMENTO ID_SEXO CLASS CD_CLASSE NR_ANOLETIVO CD_ESCOLA CD_GRAU NR_SERIE TURMA CD_PERIODO...
asked by 16.11.2017 / 17:06
2
answers

Create more fields and avoid JOIN decreases load?

I have 3 tables that are linked: 1ª tabela: GRADE (grade de horários) Campos: ID - GRADE - ESTADO - VALIDADE 2ª tabela: BLOCOS (blocos de horários da grade) Campos: ID - ID_GRADE - BLOCO - DIA_SEMANA - DURACAO 3ª Tabela: COMERCIAIS resumi...
asked by 23.06.2016 / 21:09
4
answers

How to join two rows in SELECT?

I have a problem with joining 2 lines. I researched a lot, but found nothing that could solve my case. In the query below, there are two SELECTs, which return two rows for each extension, as shown below. In the code, I need to merge these two...
asked by 15.04.2016 / 14:18
1
answer

Left Join repeat tables

I'm trying to mount a select that has the result below: With the select below I can see null in only one column. How could I make it work for 20? I have item_1 through item_20 and the item description is in the parts table, in the occ...
asked by 07.03.2016 / 19:05
1
answer

how to make an inner join getting the description

My tables: agencias (id, nome_agencia, ads -> FK pra tabela de baixo) ads (id, nome, agencia -> essa é FK pra tabela anterior) The problem is this: each agency will have ads no ads have a lead agency I want to make a select display...
asked by 14.12.2015 / 16:08
2
answers

Get records of 3 tables with JOIN

I need to get data from 3 tables in the same SELECT. I need only get the user data from the users table, get the amount of quotas (column quantity_cotas) that the user has from the quotas table (if you have registration in that user table) a...
asked by 31.12.2015 / 04:43