Solved

Need SQL Debug Help

Posted on 2014-02-13
3
243 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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Need Counts 11 43
Link SQL table to Webpage 9 39
Sort by Month and Year - SQL 3 23
Convert SP in a format for debugging 7 13
Everyone has problem when going to load data into Data warehouse (EDW). They all need to confirm that data quality is good but they don't no how to proceed. Microsoft has provided new task within SSIS 2008 called "Data Profiler Task". It solve th…
Ever wondered why sometimes your SQL Server is slow or unresponsive with connections spiking up but by the time you go in, all is well? The following article will show you how to install and configure a SQL job that will send you email alerts includ…
Viewers will learn how to use the INSERT statement to insert data into their tables. It will also introduce the NULL statement, to show them what happens when no value is giving for any given column.
Viewers will learn how to use the SELECT statement in SQL and will be exposed to the many uses the SELECT statement has.

759 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now