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...
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...
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...
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...
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')...
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...
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...
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...
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_...
<?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....