join - Trying to create one table from four -
I am trying to create a query that draws results from at least three different tables with multiple relationships I
I want to end with a table that lists cases, results and complaints.
There can be no one in all cases, one or many results, the same relationships apply to complaints I want to be able to be listed once, then the subsequent columns will list all the results and complaints related to that matter for. Instead of repeating the cases, I have tried to GROUP_CONCAT
to get results in a column, but when I use UNION
to unite the results and complaints I do, a column header overwrites the other.
Any help is appreciated and there is a link to Bella
Query structure: Select
c.caseID, c.caseTitle, c.caseSynopsis / * if more columns ... also add to group * /, group_concat (co.concern), group_concat (Resource Text) from Kesmith Smith C CEET JOIN JNGGNCNCARNCNSMMRI JCC ON CCC CIDID = JCC Cassariery / F. JCC in the form of lower birth attendance. with. Connancy_FK = Co.ConcornIdID Join LeftJNCRRCURACARAR JRC on C CACID = JRC joins CACSIMIRAF again Result as RESULTS at JRC.result_FK. Add CACID, CC Citillery, CesEncipis / * and more ... Also here * /;
Explain the table case as the most important and then everything else is "hanged"
Please note that though MySQL will allow it, - All columns should be kept, which you include in the selected clause in the group by the clause.
Also see:
Comments
Post a Comment