SELECT
d.code,
d.description,
v.code AS divCode,
v.descripton AS divDescript,
b.code AS brhCode,
b.description AS brhDescript
FROM
Department d FULL OUTER JOIN Division v
ON d.dptID = v.deptID
FULL OUTER JOIN Branch b
ON v.divID = b.divID
FULL OUTER JOIN Section s
ON b.brchID = s.brchID
FULL OUTER JOIN unit u
ON s.sectionID = u.sectionID
I have built a FULL OUTER JOIN.
For example, if I created an attribute called "TypeName" and defined
as an int data type in each table and those values of the attributes
are from a type table.
Department.typename = type.index_id
Division..typename = type.index_id
branch.typename = type.index_id
section.typename = type.index_id
unit.typename = type.index_id
Where/how should I stick those conditional statement in the query
statement to print out the type name as well as a result?