Sooo in our database, there is a table of prosecution cases with a prosecution ID and case code. There is another table of court updates (( It's a one-to-many relationship in the sense that one prosecution-case can have multiple court updates))
I am trying to create a report to show cases and their multiple court updates and I don't know how to write a query that has the following columns - Litigation Case Code & Court Updates.
This is the sample prosecution table
╔════╦═════════════════════╗
║ID ║ ProsecutionCaseCode ║
╠════╬═════════════════════╣
║ 1 ║CASE158SG ║
╠════╬═════════════════════╣
║ 2 ║CASE688ZY ║
╠════╬═════════════════════╣
║ 3 ║CASE999SS ║
║ ║ ║
╚════╩═════════════════════╝
This is the sample Court Update Table (CUid is court update Id)
╔════╦══════════════╦═════════════════════════════════════╗
║CUid║ ProsecutionID║ UPDATE ║
╠════╬════════════ ═╬═════════════════════════════════════╣
║ 1 ║ 1 ║ 14th May - Judge wore pink ║
╠════╬══════════════╬═════════════════════════════════════╣
║ 2 ║ 1 ║ 13th May - Judge wore black ║
╠════╬══════════════╬═════════════════════════════════════╣
║ 3 ║ 1 ║ 12th May - Judge wore orange ║
╠════╬══════════════╬═════════════════════════════════════╣
║ 4 ║ 2 ║ 29th November - Judge was a no-show ║
╠════╬══════════════╬═════════════════════════════════════╣
║ 5 ║ 3 ║ 19th January - Judge is cute lol ║
╠════╬══════════════╬═════════════════════════════════════╣
║ 6 ║ 3 ║ 1st January - Judge was mean ║
╚════╩══════════════╩═════════════════════════════════════╝
this is the report I am trying to create
╔════╦═════════════════════╦════════════════════════════════════════╗
║SNO ║ ProsecutionCaseCode ║ COURT UPDATE ║
╠════╬═════════════════════╬════════════════════════════════════════╣
║ 1 ║CASE158SG ║ 14th May - Judge wore pink ║
║ ║ ║ 13th May - Judge wore black ║
║ ║ ║ 12th May - Judge wore orange ║
╠════╬═════════════════════╬════════════════════════════════════════╣
║ 2 ║CASE688ZY ║ 29th November - Judge was a no-show ║
╠════╬═════════════════════╬════════════════════════════════════════╣
║ 3 ║CASE999SS ║ 19th January - Judge is cute lol ║
║ ║ ║ 1st January - Judge was mean ║
╚════╩═════════════════════╩════════════════════════════════════════╝