May 8, 2010 at 1:55 pm
I get this message when working on this query.
Msg 4104, Level 16, State 1, Line 13
The multi-part identifier "Job_title.Job_title" could not be bound.
Msg 207, Level 16, State 1, Line 13
Invalid column name 'Job_title'.
Here is the code
USE master
USE FindleyKFFv4
--/query 5/--
--/creating table/--
SELECT Last_Name, First_Name, State, Employee.[Foreign Key from Job Title Table], MinSalary, MaxSalary
INTO Total
FROM Employee, Job_title
WHERE Employee.[Foreign Key from Job Title Table] = Job_title.Job_title
Select * from Total
--/counting all job titles--
SELECT COUNT(Job_title) AS Cashier
FROM Total
WHERE Job_title.Job_title = 'Cashier'
SELECT COUNT(Job_title) AS Bagger
FROM Total
WHERE Job_title = 'Bagger'
SELECT COUNT(Job_title) AS Stocker
FROM Total
WHERE Job_title = 'Stocker'
SELECT COUNT(Job_title) AS Retail_Asst_Butchers_SeafoodSpecialists
FROM Total
WHERE Job_title = 'Retail Assistant Butchers and Seafood Specialists'
--calculating for below minimum salary
SELECT Last_Name, First_Name, Employee.[Foreign Key from Job Title Table], Salary FROM Employee
INNER JOIN Job_title
ON Employee.[Foreign Key from Job Title Table] = Job_title.Job_title
WHERE Salary < MinSalary
GROUP BY Last_name, First_Name, Employee.[Foreign Key from Job Title Table], Salary
ORDER BY Last_name
--caluclating for above maximum salary
SELECT Last_Name, First_Name, Employee.[Foreign Key from Job Title Table], Salary FROM Employee
INNER JOIN Job_title
ON Employee.[Foreign Key from Job Title Table] = Job_title.Job_title
WHERE Salary > MaxSalary
GROUP BY Last_name, First_Name, Employee.[Foreign Key from Job Title Table], Salary
ORDER BY Last_name
May 9, 2010 at 1:42 pm
the TOTAL table does not contain a column job_title
---------------------------------------------------------------------
Viewing 2 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply