I’m trying to create a list of all our employees by last
name with their dependents by first name, and birth dates. My output columns
are emp_last_name from the employee table and dep_name and dep_date_of_birth.
Here is what I’ve specifically been tasked with doing:
- Use alias table names.
- Name each column appropriately
- Sort the result table by emp_last_name.
- Use the CAST statement to produce a listing that
fits easily on one page.
To make matters worse, I’m teaching myself SQL Server to do
this. My code so far is as follows:
SELECT emp_last_name"Employee Last Name",
CAST(dep_date_of_birth as char(12))"Dependent Date of Birth"
from employee dependent
ORDER BY emp_last_name;
I cannot figure out
how to join it because there are so many dependents with the same last name.
September 16, 2013 6:59 PM
September 17, 2013 5:24 PM