Questions tagged as 'join'

1
answer

Check MySQL counts to 0 with Joins

I have these four tables related to each other (ignore the relationships that go upwards). I will use a query so that you can understand the problem, which is complex: SELECT u.nombre, COUNT(fr.id_tipologia), t.nombre FROM tipologias...
asked by 28.08.2018 / 10:20
3
answers

Bring missing items with LEFT JOIN

Starting from two tables lessons lessons.lessons_id, lessons.lesson_number, lessons.course_id entre otras and lessons_completed lessons_completed.lessons_number, lessons_completed.user_id, lessons_completed.completed With the...
asked by 14.08.2018 / 18:15
2
answers

Problems showing related data in Codeigniter

It turns out that I have a problem I want to show the name of tables related to inner join in Codeigniter but it does not let me not know what I'm doing wrong. Controller public function consulta() { $asociados = array("tablaAsoci...
asked by 03.08.2018 / 05:21
1
answer

Add the value of each period and put 0 in the periods that do not exist in SQL Query table

I have two Income and Periods tables, within the Periods table are the months from January to February and in Income I have a value_port column in which there are records for what has been contributed in each month. ex. Ingresos Periodo Valor_...
asked by 06.04.2018 / 23:02
1
answer

See left join with 6 tables

I have 6 survey tables, form_alumnos, dimension, questions, answer_type, answer. Table form_alumnos and I have this query SELECT p.id_pregunta, tr.tipo, COUNT(r.id_respuesta) as cantidad_respuestas FROM encues...
asked by 15.11.2017 / 22:10
2
answers

SQL Joins, select data from different tables

I'm having problems selecting data from different tables, I explain. I have three tables and I occupy certain data of each of them: usuarios AS u u.id u.usuario proyecto_emp AS p p.id_proyecto p.us_id p.rol roles AS r r.id r.rol...
asked by 28.08.2017 / 23:53
0
answers

SQL query with "left join" and an "if" in PHP [closed]

I have this query: $customers_query_raw = "select ex.codigo_op, ep.entrega01_clave, ep.descripcion_articulo, ep.entrega01_envases, ep.entrega01_importe from " . TABLE_EXPORT_PATRIMONIO . " ep left join " . TABLE_EXPORT_COMPARATIVA_PATRI . " ex...
asked by 08.08.2017 / 12:13
4
answers

Problem Left join mysql [closed]

I need to do a left join in MySql and it's not working. I have 4 tables: articulos , subcategoria , categoria and ventas . I want to show all the independent items that have sales or not. Each article has a sub...
asked by 23.03.2017 / 15:24
1
answer

sql queries with sql server 2016

I'm writing to see what's wrong with this query: Name of the teacher who teaches all subjects first select nombre from profesor inner join imparte on (profesor.p# = imparte.p#) group by nombre having (curso like "primero")     
asked by 13.06.2016 / 19:40
1
answer

I can not join two users to the same room with socket.io

I'm doing an app with express, mongoose, and socket.io. My intention is to make that when a user enters, he joins a room whose name is the name of the city with which he registered. The idea is that when a user A and B belong to the same city,...
asked by 10.05.2016 / 08:18