Say I have a table of departments:
departments
-----------
DepartmentID DepartmentName
------------------------------
1 Department 1
2 Department 2
And a table as follows:
contacts
--------
ContactID ContactName MainDepartment SecondDepartment
-------------------------------------------------------------
1 Fred Bloggs 1 2
2 Bob Smith 2 2
How would I create a view with the names for both MainDepartment and SecondDepartment?
contactview
-----------
ContactID ContactName MainDepartmentName SecondDepartmentName
-------------------------------------------------------------------
1 Fred Bloggs Department 1 Department 2
2 Bob Smith Department 2 Department 2
I tried CROSS JOIN but that did not work (1 entry in contacts resulted in one row in the view, but 2 entries resulted in 8)
Thread Closed
This thread is kinda stale and has been closed but if you'd like to continue the conversation, please create a new thread in our Forums,
or Contact Us and let us know.