Questions tagged as 'join'

1
answer

Display Results Replied

Good evening, I'm creating an indication system, But the query result does not return users with zero statements Here's my select SELECT c.id, c.nome, funcao, area, count(p.cpf_cli) AS quantidade FROM col c LEFT JOIN...
asked by 05.10.2018 / 03:46
1
answer

List data from 2 tables linked to parent table

ORDERS TABLE --------------------------- | id_pedido | pedido_data | --------------------------- | 1 | 2016-01-01 | --------------------------- TITLE ORDER_ITENS ------------------------------------- | id_item | id_pedido | v...
asked by 16.09.2016 / 03:53
1
answer

filter between two dates with join

I have two tables: col (contributor) and Indicacao . I made select to know how many leads each employee has. It is working but I can not filter by date using between . SELECT c.id, c.nome, funcao, area, count(p.cpf...
asked by 22.09.2018 / 02:45
1
answer

Query in 2 tables that have columns with the same name

sql = "SELECT * FROM configuracao b LEFT JOIN dividas a on (b.registro = a.registro) and (b.empresa='" & Left(Combo1.Text, 2) & "') left JOIN registros r on (b.registro = r.registro) and (b.empresa='" & Left(Combo1.Text,...
asked by 24.08.2018 / 13:50
0
answers

Use cursor to update a MySQL table, based on a search

I would like some guidance on a challenge in MySQL 8. I have two tables: usuarios (id_user, nome, nascimento, endereço, cidade, ...) utilizacao (id_medicamento, nome, nascimento, medicamento, data, ...) The usuarios table stores all...
asked by 24.08.2018 / 15:20
1
answer

Deleting using subquery and join

Dear, I'm starting in SQL and I'm having a hard time making a deletion using subquery and join. I created a temporary table EVENT_ITEM_PLACE_DYN_FIELD_BKP with 7000 rows, I need to delete a records from the EVENT_ITEM_PLACE_DYN_FIEL...
asked by 16.07.2018 / 21:36
0
answers

Creation of slow materialized view

Good evening. I'm creating a materialized view based on a JOIN with 3 tables, but it's taking too long ( 200+ minutes on the machine ). I use the appropriate indexed keys in the WHERE of each table and have already given R...
asked by 29.06.2018 / 23:49
0
answers

mysql inner join with wildcard

I need to update on a table A by taking information from table B using inner join with wildcard to compare a snippet of content and if found in B, load a column in A. To just test this join I made the select below: SELECT vinhos.* FROM vinhos...
asked by 24.06.2018 / 21:00
0
answers

Join between String and ObjectId

How to do a join between two collections, using objectid in one and string in another? Sample document event : { _id: ObjectId(5b188aa5f9bf7c4c7d3cf637) name: "aniversario" date: "2019-09-21T03:00:00.000Z" teachingInst...
asked by 07.06.2018 / 05:39
2
answers

Select data from three SQL tables

I'm trying to merge data from three tables using this sql: SELECT cod_nota, cupom, valor_contrato, valor_cadastro, data_emissao FROM cupons_nota, vendas, notas_fiscais WHERE cupons_nota.cupom = vendas.numero_nf AND notas_fiscais.cod_cliente='0...
asked by 24.05.2018 / 15:20