Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.
SELECT DISTINCT EmployeeID = e.EmployeeID, Status = es.EmployeeStatus, Start_Date = e.EmployeeStartDate, Emp_Name = e.Surname + ', ' + e.KnownAs, LoginID = e.WindowsUserName, UserID = e.DisplayEmployeeID, Extension = e.ExtNoUD, FFWMobile = e.FFWMobileUD, Email = e.WorkEmail, ProfitCentre = ch.HierarchyLevel3, Department = ch.HierarchyLevel4, EliteNumber = ejwrks.Elitenumberud, Secretary = sec.EmployeeDescNoID, Location = e.LocationUD, Position = ej1.PostID, WorksFor1 = EWF1.EmployeeDescNoID, WorksFor2 = EWF2.EmployeeDescNoID, WorksFor3 = EWF3.EmployeeDescNoID, WorksFor4 = EWF4.EmployeeDescNoID, WorksFor5 = EWF5.EmployeeDescNoID, WorksFor = EBoss.EmployeeDescNoID, AboutMe = e.AboutMeud, Responsibilites = e.Responsibilitiesud FROM [Cascade].dbo.Employee e JOIN [Cascade].dbo.Employee_Status es ON e.EmployeeID = es.EmployeeID LEFT OUTER JOIN ( select t1.JobTitle, t1.EmployeeID, t1.PostID from [Cascade].dbo.EmployeeJobs t1 join ( select employeeId, min(Sequence) as sequence from [Cascade].dbo.EmployeeJobs group by employeeID ) t2 on t1.employeeid = t2.employeeID and t1.Sequence = t2.Sequence ) ej1 ON e.EmployeeID = ej1.EmployeeID LEFT OUTER JOIN [Cascade].dbo.Employee sec ON sec.EmployeeID = e.SecretaryNameUD JOIN [Cascade].dbo.EmployeeJobs ejwrks ON e.employeeid = ejwrks.employeeid JOIN [Cascade].dbo.CompanyHierarchy ch ON ejwrks.HierarchyNodeUD = ch.HierarchyNode JOIN [Cascade].dbo.Employee eBoss ON EBoss.EmployeeID = ejwrks.WorksForEmployeeID LEFT OUTER JOIN [Cascade].dbo.Employee EWF1 ON EWF1.EmployeeID = e.Manager1ud LEFT OUTER JOIN [Cascade].dbo.Employee EWF2 ON EWF2.EmployeeID = e.Manager2ud LEFT OUTER JOIN [Cascade].dbo.Employee EWF3 ON EWF3.EmployeeID = e.Manager3ud LEFT OUTER JOIN [Cascade].dbo.Employee EWF4 ON EWF4.EmployeeID = e.Manager4ud LEFT OUTER JOIN [Cascade].dbo.Employee EWF5 ON EWF5.EmployeeID = e.Manager5ud WHERE es.EmployeeStatus = 'Current' AND ch.[InUse?] = 'Live'
|Oracle Stored Procedure for User Account data||2||28|
|t-sql split string into multiple rows||7||84|
|SQL Server - Select Distinct and Count Rows for Each Distinct Row Returned||2||20|
|Whats wrong in this query - Select * from tableA,tableA||11||31|