I happen to have 2 tables. One is the "main" table and another table where data is saved according to what is recorded in table 1. Table 1 will only have one record, while table 2 can have 2 or more records that depend on the record that was made in table 1.
When performing the JOIN, the number of records in table 2 is obtained, that is, the records in table 1 are repeated.
I have part of the solution, and it was using the aggregation function SUM (colum_name_TABLE2) , and grouping them by the ID of table 1. But, in one of the columns of table 2 the value will always be different, since it corresponds to the invoice number generated for each subscription that you made to the main record of table 1 ... At the end I need to show, the sum of one of the columns in table 2, and the different numbers of invoice that are located in another column of the same table 2.
How can I do?