Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
Bencze
Starting Member
2 Posts |
Posted - 2015-02-12 : 03:20:08
|
Hi,i have a code like this:SELECT Node_ID,Day,Operation, AA,BBFROM(SELECTCASEWHEN Operation LIKE 'NOTIFY' THEN SUM(Total_request) ELSE 0 END AS AA, CASE WHEN OPERATION LIKE 'SEARCH' THEN SUM(Total_requests) ELSE 0 END AS BB,Node_ID,DAY,OperationFROM (SELECT TO_CHAR(STARTTIME, 'YYYY-MM-DD') AS day, TO_CHAR(STARTTIME, 'HH24:MI') AS time, Node_ID, Operation, Total_requests FROM requests WHERE STARTTIME >= TO_DATE('20150206', 'YYYYMMDD') AND STARTTIME < TO_DATE('20150213', 'YYYYMMDD') ))GROUP BY Node-ID, Day, AA,BBSo i want to make two columns by the name of operation. in the real code AA and BB are calculates with many counters. my code doesnt work,i have an error: "not a single-group group function"could you help me what is the problem?thanks, |
|
Bencze
Starting Member
2 Posts |
Posted - 2015-02-12 : 04:49:55
|
it's OK now,question is obsolete. :) |
|
|
|
|
|
|
|