Questions tagged as 'join'

1
answer

Displaying null results for mysql related tables

I need to create a relational query that returns records containing data from both the PERMISSION table and the USERS table. ALL PERMIT records must be displayed. When no records exist in the USER, NULL must be displayed. PERM_USU is used to rel...
asked by 18.02.2015 / 16:10
1
answer

How to get the latest releases from an inner join

Personal to doing a query in 3 tables with inner join, follows the code: select itensVenda.idVenda, itensVenda.idProd, itensVenda.qtd, produtos.id, produtos.descricao, produtos.foto, venda.id, venda.valor from prod...
asked by 30.08.2018 / 22:41
1
answer

Join SQL server

Good afternoon, I started working with sql 3 months ago and I'm getting caught up in an application. I have 3 tables which I have information associated with the "registry" I would like to get all the information from the first table named...
asked by 15.08.2018 / 22:36
1
answer

MySql - inner join runs in PHPADMIN but in SCRIPT php does not

I have a small PHP script to interact with MAKERIOD. When I execute the select in PHPADMIN I have the return: "Showing records from 0 - 16 (17 total, Query took 8.0945 seconds.)" SELECT Tbdiario.cn1, Tbdiario.cn2, Tbdiario.cn3, Tbdiario.cn4, A...
asked by 30.07.2018 / 19:08
1
answer

Return data in JSON into an array, replacing the database ID with their names. How can I do this?

I made this code, but it only returns me the ids, and I would like instead of the ids it does a search for the inner join in the database and returns in place of the ids the names. Code php: <?php header('Content-Type: application/json')...
asked by 26.05.2018 / 13:37
1
answer

Join multiple fetch returning duplicate JPA Criteria API values

In the method in question I want to return the query with the joins of employee and company. However, the Company class is related to the Query and to the Employee, and is returning duplicate in the JSON. Query class @Entity @Table(name="CO...
asked by 04.04.2018 / 20:44
2
answers

Problem with inner join in MySQL

I'm trying to create a query to bring results that are in different tables in MySQL , but I'm not getting it. I have experience in JOIN in SQL , but I'm getting a little to do in MySQL , can you help me? I already consulted here on the...
asked by 21.03.2018 / 03:39
1
answer

Left Join returning only 1 record for each relationship

I need to do a Join between 2 tables where I need only to display the last record of the 2nd table (only 1 record of table 2 for each record of table 1). SELECT a.Campo1, a.Campo2, a.Campo3, a.Campo4, b.Campo1, b.Campo2 FROM Tabela1 a LEFT JOI...
asked by 20.02.2018 / 21:21
1
answer

Update the rest of a table from the data contained in a row

The following figure explains well what I want to try (and what I tried to do but it did not work): That is, I need to update some rows of a table with the same data contained in a row (specifically the columns bankId, proj_day and liq_...
asked by 16.01.2018 / 01:36
0
answers

datatables does not show the data with a query using JOIN. What to do?

<?php include('../conection/db.php'); include('function.php'); $query = ''; $output = array(); $query .= "SELECT i.Tipo as Tipo, c.Descricao as Descricao, c.Anexo as Anexo from tbl_instituicao as i JOIN tbl_conteudo as c ON i.Id_conteudo = c....
asked by 03.11.2017 / 10:29