Solved

Need SQL Debug Help

Posted on 2014-02-13
3
255 Views
Last Modified: 2014-02-13
I have a query that's running just fine until I try to add a GROUP BY clause. I have no formal SQL training and have tried a number of approaches but cannot figure out how to get the GROUP BY to work. Is there a DBA or SQL Jock out there who can help me with a GROUP BY on a query involving coalesce? Much appreciated.
GROUP-BY-NOT-WORKING.docx
0
Comment
Question by:gberkeley
  • 2
3 Comments
 
LVL 34

Accepted Solution

by:
Brian Crowe earned 500 total points
ID: 39857818
You're not using any aggregate functions that I can see so why are you grouping?  If your intent is to eliminate duplicate rows then just use DISTINCT.

SELECT DISTINCT <column list>
FROM HAR_CALLS
LEFT OUTER JOIN CALL_DISABILITY
    ON HAR_CALLS.CALL_UUID = CALL_DISABILITY.CALL_UUID
WHERE HAR_CALLS.START_DATE >= N'10/01/2012 00:00:00'
   AND HAR_CALLS.START_DATE <= N'10/31/2012 12:59:59'
0
 

Author Comment

by:gberkeley
ID: 39857822
Testing - thank you for the fast help!
0
 

Author Closing Comment

by:gberkeley
ID: 39857833
Thank you for the quick help and I learned something new!
0

Featured Post

MS Dynamics Made Instantly Simpler

Make Your Microsoft Dynamics Investment Count  & Drastically Decrease Training Time by Providing Intuitive Step-By-Step WalkThru Tutorials.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
SQL Pivot table 2 42
Need to merge 3 large tables into one Table in SQL server 2 19
SQL 2014 missing dll from Bin? 3 31
add stored proc on publlication 4 15
Introduction SQL Server Integration Services can read XML files, that’s known by every BI developer.  (If you didn’t, don’t worry, I’m aiming this article at newcomers as well.) But how far can you go?  When does the XML Source component become …
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Via a live example, show how to set up a backup for SQL Server using a Maintenance Plan and how to schedule the job into SQL Server Agent.
Viewers will learn how to use the SELECT statement in SQL and will be exposed to the many uses the SELECT statement has.

679 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question