Questions tagged as 'join'

0
answers

How to Assign Vacancies from one table to Patients from another table

Galera for a project of dental consultations I need to relate two tables of patients and vacancies in order to assign the first patient who came in contact requesting a specific specialty (orthodontics, whitening, etc.) the first available wave...
asked by 21.05.2018 / 21:33
1
answer

How to do MYSQL subtraction

How to correctly subtract these two columns in the SQL script? SELECT DISTINCT b.prefixo as idVeiculo, max(datatroca) as datatroca, max(kmtroca) as kmtroca, max(horimetroca) as horimetroca,...
asked by 01.05.2018 / 23:45
1
answer

Return values if any records do not exist

I have the tables: tabelaUm [id] [nome] 1 nome1 2 nome2 tabelaDois [id] [idTabelaUm] [nome] 1 1 nome1 1 1 nome2 1 1 nome3 1 2 nome4 1 2 nome5 1 2 nome6...
asked by 03.05.2018 / 04:31
1
answer

Join two SQL queries MariaDB

Two tables tab_Ord_Ser and tab_Pos_Alb . In two different queries I can know the values but I can not unite them in just one. These are: SELECT Prazo_Producao as Data, COUNT( 'Numero OS' ) AS Produzir, Tipo_Album FRO...
asked by 24.04.2018 / 21:18
0
answers

JOIN to search for the most recent date

I'm having trouble doing a specific search through sqlite. I am using this command to join two tables: SELECT p.idpovoamento,p.ostricultor,p.data_inicial, b.data_coleta,b.sistema_producao,b.qauntidadetotal,b.estagio_crescimento FROM povoamento...
asked by 24.04.2018 / 00:05
2
answers

consult with inner join in codeigniter

Good afternoon, I would like to request your help in something that I have broken my mind to solve and I can not fix it to work out I have 4 tables products -> id | slug | title | info1 | info2 | info3 prodnutri - > idNutricion | i...
asked by 10.04.2018 / 03:58
0
answers

Foreign Keys Are "Breaking" Lines in Export

Good morning! I'm having difficulty exporting a SELECT that I created, it happens that when using INTO OUTFILE the file that is exported is breaking the lines where "Join" exists. So I ask your help so that I can solve this problem. Note: Whe...
asked by 10.04.2018 / 15:28
1
answer

Call list + Subscribers and participants per event

I have the following tables: I need to list COMPANIES and REGISTERS IN THE EVENT (which can have more than one talk) and in the same line bring the QTD OF GIFTS by lecture in columns ... Thus I would get a parameter of use per lecture i...
asked by 30.03.2018 / 22:28
1
answer

Help in Sql that queries 2 fields from the same table

I have the following problem to solve: I need to make a Sql that queries an X table "Tabela X": id coluna1 coluna2 "Tabela 2": id coluna1 coluna2 coluna3. In "Table X" column1 and column2 are foreign keys of "table 2" both with differe...
asked by 15.03.2018 / 14:57
0
answers

Query mysql with special condition

I'm having trouble putting together a query with two tables. In my bd I have two tables called disciplines and bulletin, in disciplines have the data of each discipline and in bulletin has the foreign keys referring the student and the discip...
asked by 19.02.2018 / 00:04