Please note that I am a complete SQL noob and in the learning process. Based on Google search results (including search here), I tried using SELECT DISTINCT and GROUP BY, but none of them work, probably due to all my connections (if anyone knows why they wonβt work for sure, that was would be useful for learning).
I need data from different tables, and below is the only way I know this (I just know the basics). The following query works fine, but shows duplicates. I need to know how to remove them. The only hint I have now is perhaps a sub-SELECT query, but based on the research, I'm not sure how to implement them. Any help at all would be great, thanks!
USE SQL_Contest go SELECT CLT.Description AS ClockType, CLK.SerialNumber AS JobClockSerial, SIT.SiteNumber AS JobID, SIT.[Name] AS JobsiteName, SIT.Status AS SiteActivityStatus, DHA.IssuedDate AS DHAIssuedDate,
EDIT: In the near future I will consider these answers, thank you very much. I send additional duplicate information to Rob's request:
Everything is displayed fine until I add:
LEFT JOIN tb_Session SES ON SES.ClockSerialNumber = CLK.SerialNumber
What I need. This is when a duplicate appears:
JobClock 2,500248E4,08-107,Brentwood Job,1,2007-05-04 13:36:54.000,2007-05-04 13:47:55.407,3049 JobClock 2,500248E4,08-107,Brentwood Job,1,2007-05-04 13:36:54.000,2007-05-04 13:47:55.407,3049
I want this information to be displayed only once. Essentially, this query is to identify all active jobs that have an assigned clock, and this task has only one beat assigned to it, and this is only one workspace, but it appears twice.
EDIT 2: Based on the help you provided you, I was able to determine that they are NOT really duplicates, and each session is independent, this is the only time you had two sessions. So, now Iβll try to figure out how to extract information from the last session.