Mutliple SQL Joins with one-many relationships

Mutliple SQL Joins with one-many relationships

gforstergforster Posts: 40Questions: 19Answers: 1

I am trying to figure out how best to deal with multiple joins where there are multiple one-many relationships.
The desired DataTables display result (also to be edited in Editor):

Volume_A | Service_1 | url_1, url_2
         | Service_2 | url_3
         | Service_3 |
------------------------------------
Volume_B | Service_1 | url_5, url_6
         | Service_4 |

That information would be populated by the following tables:

CUSTSVCS
id, name, description

URL
id, name, notes

CUSTSVC_URL
id, custsvc_id, url_id

VOLUME
id, name, description, other_junk

HOST_CUSTSVCS
id, volume_id, custsvc_id


I can rather easily display the Volume and associated services, but not the URL tied to each service on each specific volume. Maybe there is a better way to structure the database?

Answers

  • allanallan Posts: 64,921Questions: 1Answers: 10,753 Site admin

    Its not really something that DataTables supports that I'm afraid. What you could do is read the data from the database so that each row in the table is fully represented in the JSON and then use some client-side manipulation to remove the data that isn't required (for example the two cells under Volume_A).

    How are you currently implementing this (what you've got so far)?

    Allan

This discussion has been closed.