Quantcast
Channel: Teradata Forums - All forums
Viewing all articles
Browse latest Browse all 27759

SELECT Failed 3504: Selected non-aggregate values must be part of the associated group - forum topic by MMM

$
0
0

I am not sure why an erorr message is occurring in my query. What am I doing wrong?
 
 
SELECT SUM(MEM_COUNT) MBR_MNTH,
P1_MBRMTH
FROM
(
SELECT
COUNT (MB.MB_JOIN_KEY) MEM_COUNT,
CASE WHEN MB.EFF_BEG_DT >= '2009/01/01' AND MB.EFF_END_DT <= '2009/01/31' THEN 'YES' ELSE 'NO' END AS P1_MBRMTH
FROM MB_TABLE MB
WHERE (MB.EFF_BEG_DT >= '2009/01/01' AND MB.EFF_END_DT <= '2009/01/31') OR
(MB.EFF_BEG_DT >= '2009/03/01' AND MB.EFF_END_DT <= '2009/04/30')
)MMM_MB
GROUP BY MEM_COUNT, P1_MBRMTH
;
 

Forums: 

Viewing all articles
Browse latest Browse all 27759

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>