Answer the question
In order to leave comments, you need to log in
Why is there a selection twice in a SQL query?
SELECT GROUP_CONCAT(CONCAT('<img class=\"ps-icon\" title =\"',
IF(`cpl_method_get`.`name` = `cpl_method_get`.`group`, `cpl_method_get`.`group`, CONCAT(`cpl_method_get`.`group`, ' (', `cpl_method_get`.`name`, ')')),
'\" src=\"/img/ps/icon/', `cpl_method_get`.`img`, '.png\" >') SEPARATOR ' ') as `method_get`
FROM `cpl_mfo` JOIN `cpl_mfo-method_get` ON `cpl_mfo`.`name` = `cpl_mfo-method_get`.`mfo` JOIN `cpl_method_get` ON `cpl_mfo-method_get`.`method_get` = `cpl_method_get`.`name` JOIN `cpl_mfo_loans` ON `cpl_mfo_loans`.`mfo_id` = `cpl_mfo`.`id`
JOIN `cpl_mfo_loans` ON `cpl_mfo_loans`.`mfo_id` = `cpl_mfo`.`id`
Answer the question
In order to leave comments, you need to log in
Your mfo "E-Cabbage" corresponds to 4 entries in cpl_mfo_loans.
This means that after the last join you will have 4 lines for E-Cabbage, in which the fields of all tables except cpl_mfo_loans will be the same. You concatenate them with group_concat, so you end up with the same thing 4 times. I advise you to remove group_concat and put SELECT *, then it will be clearer to you what data is there.
PS for the future: lay out the structure of tables and dumps in the form of SQL queries (CREATE TABLE, INSERT), it is very difficult to understand by eye screenshots.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question