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 |
kamii47
Constraint Violating Yak Guru
353 Posts |
Posted - 2015-02-23 : 00:48:44
|
I have a query SELECT `TELCOID`, COUNT(*) smsCount FROM `smsout` WHERE `STATUS` = 'Send' AND (RECEIVEDTIME BETWEEN DATE_SUB(NOW(), INTERVAL 1000000 MINUTE) AND NOW()) GROUP BY `TELCOID` My result isTELCOID smsCount-10 7-5 38-4 1-3 119-1 3112163 2193 2what i want to check if the Sum of all smscount is grreater then certain number [let's say 2000] then result comes other wise nothingHow can i do thisKamran ShahidPrinciple Engineer Development(MCSD.Net,MCPD.net) |
|
ahmeds08
Aged Yak Warrior
737 Posts |
Posted - 2015-02-23 : 06:38:13
|
is this you wanted?SELECT `TELCOID`, COUNT(*) smsCount FROM `smsout` WHERE `STATUS` = 'Send' AND (RECEIVEDTIME BETWEEN DATE_SUB(NOW(), INTERVAL 1000000 MINUTE) AND NOW()) GROUP BY `TELCOID`having smsCount>2000Javeed Ahmedhttps://www.linkedin.com/pub/javeed-ahmed/25/5b/95 |
|
|
|
|
|