Questions tagged as 'join'

1
answer

Limit number of records and sort them

I have two tables one of clients and one of sales where I must select the 30 LATEST records added to the sales table, show the information of the clients that made those transactions and order them upwards with respect to the id of sales...
asked by 18.07.2018 / 01:32
1
answer

How to show a start and end range grouped by states in MySql?

I have a table called documents with three registers id, number, state. What I want to do is get a query with the intervals (min and max) for each record. To be more descriptive if the table is filled, with the following data: | numero...
asked by 21.11.2017 / 06:05
1
answer

Problems with JOIN MySql

Dear friends, I really have a serious problem, I have several tables that store certain information of users such as their facebook, twitter, instagram, image, email, etc ... I will show the SQL and explain the problem: SELECT IF...
asked by 25.03.2018 / 20:27
1
answer

Search engine that queries two different tables laravel 5.4

Description The search engine currently makes a query to the news table where it finds the data by ( news_program, noticiero_turno, news_date ), the question is How can you make in that same query extract data from the another table that is ca...
asked by 25.03.2018 / 01:17
1
answer

How to consult with JPQL or CriteriaBuilder?

I have three Classes: Client, Loan, Collector customers have many loans collectors have many loans a loan belongs only to a client and a collector, it must be the same for both between the clients and the loans there is a table that...
asked by 29.01.2017 / 21:08
1
answer

SQL statement with INNER JOIN to pull a column of two tables in Java

I need help with a SQL statement. I have never worked with INNER JOIN and I can not do it correctly. As you can see in the previous image, what I'm looking for is this: Save the id_invitacion of the table invitacion...
asked by 05.12.2016 / 04:40
2
answers

postgres duplicate results in multiple inner join

I have a db in postgres with the following structure. tbl_predio =========== predio_id predio_nombre tbl_propietario ============== propietario_id propietario_nombre propietario_idpredio tbl_linderos =========== lindero_id lindero_nombre lin...
asked by 24.08.2016 / 16:08
1
answer

How to generate a query of two foreign keys that point to the same table?

I am developing a system to control X services, as I suppose I have a table called ' services ' where I keep all kinds of services, structurally the table is this: This table contains two fields called fidusuario_recepcion and fidu...
asked by 18.09.2016 / 05:37
1
answer

sql server subqueries 2016

It is necessary to know the name of the students whose average grade of programming of the second year is higher than that of the program. Here I enclose my query: select nombre from alumno innner join matricula on (alumno.#a=matricula.#a...
asked by 14.06.2016 / 19:22
1
answer

Perform a left join and assign the value of a column conditioned by a field

Good afternoon, I have 2 tables and I'm doing left join of T1 with T2 to extract the client code. The problem is that there are 2 client codes for the same (RUC) in some cases (this because of the client's condition, which i...
asked by 04.04.2017 / 19:14