0
Hello,
I have two tables, one representing the groups (Certification.certification_adm_email - columns start with "fall"), and the other users (admin.dbuser - columns start with "user"). Among them there is an nxn table doing the intermediation (Certification.caem_dbuser - columns start with "cadb"). I need to make a query that returns me to a group, all users registered in it. However, my search is returning only one result to this field I called members_desc. Could anyone help, please?
For now, my code is like this:
SELECT
caem_seq,
caem_code,
caem_desc,
cadb_user_seq,
cadb_caem_seq,
(SELECT LIST(user_name || '-' || user_elogin || '-' || cmpn_desc || '-' || user_email, '<br>' ORDER BY user_name)
FROM admin.dbuser
JOIN admin.company ON cmpn_seq = user_cmpn_seq
WHERE user_seq = cadb_user_seq
) AS members_desc
FROM certification.certification_adm_email
LEFT JOIN certification.caem_dbuser ON cadb_caem_seq = caem_seq
For us to help you better, create an example of http:/sqlfiddle.com/ site with data and example of the result you expect from
SQL
– Tiedt Tech
It is important you mark the tag of the DBMS used to facilitate who will respond.
– anonimo