Accounts with fewer than the normal amount of channels: select accountID, accounts.description, count(1) as 'numChannels' from accountChannelMap join tsacommon.accounts on accountID=accounts.id where isActive='true' and databaseInstance=1 group by 1 having count(1) < 10; +-----------+--------------------------------------------+-------------+ | accountID | description | numChannels | +-----------+--------------------------------------------+-------------+ | 14 | The Search Agency Demo | 3 | | 18 | Bills.com - FFN | 4 | | 154 | ValueClick - YourInkStation | 1 | | 222 | Ampere Media | 1 | | 263 | Freedom Communications | 3 | | 264 | 61 Holdings - JB123.com | 6 | | 266 | Willow | 1 | | 282 | Microsoft - Windows Live Search Mobile | 1 | | 305 | Bella Pictures | 1 | | 320 | Renovation Experts | 7 | | 323 | Actuate Java | 5 | | 326 | Renovation Experts - City Sites | 6 | | 329 | Travel Channel | 1 | | 335 | Move.com - Realtor Alabama - Florida | 1 | | 336 | Move.com - Realtor Georgia - Maine | 1 | | 337 | Move.com - Realtor Maryland-New Hampshire | 1 | | 338 | Move.com - Realtor New Jersey-Rhode Island | 1 | | 339 | Move.com - Realtor South Carolina-Wyoming | 1 | | 372 | Travel Channel Academy | 1 | | 376 | Deutsch - Playstation - MLB10 The Show | 1 | +-----------+--------------------------------------------+-------------+ 20 rows in set (0.03 sec) select accountID, accounts.description, count(1) as 'numChannels' from accountChannelMap join tsacommon.accounts on accountID=accounts.id where isActive='true' and databaseInstance=5 group by 1 having count(1) < 10; +-----------+----------------------------------------------+-------------+ | accountID | description | numChannels | +-----------+----------------------------------------------+-------------+ | 230 | Move.com - New Homes Dynamic | 1 | | 430 | Spark - AmericanSingles | 1 | | 436 | Spark - CanadianPersonals | 1 | | 462 | Renovation Experts - Remodeling Contractor | 1 | | 477 | Daily Candy | 6 | | 480 | Yell - Brand and Ad Hoc | 3 | | 481 | Exercise TV | 6 | | 485 | Yell BTs - 043-048 | 3 | | 486 | Yell BTs - 061-066 | 3 | | 487 | Yell BTs - 049-054 | 3 | | 488 | Yell BTs - 055-060 | 3 | | 489 | Fuel TV | 2 | | 518 | Spark - Black-Dating | 1 | | 519 | Spark - Christian-Dating | 1 | | 520 | Spark - AmericanMatch | 1 | | 521 | Yell BTs - 001-006 | 3 | | 522 | Yell BTs - 007-012 | 3 | | 545 | Renovation Experts - Wedding Day Experts | 1 | | 549 | Deutsch - Playstation - Infamous | 1 | | 561 | Yell BTs - 013-018 | 3 | | 565 | Deutsch - PSP Go | 1 | | 571 | Yell BTs - 019-024 | 3 | | 572 | Yell BTs - 025-030 | 3 | | 573 | Yell BTs - 031-036 | 3 | | 574 | Yell BTs - 037-042 | 3 | | 586 | CyberDefender Early Detection Center | 2 | | 597 | Singapore Airlines | 1 | | 604 | Deutsch - PSP Hannah Montana Bundle | 2 | | 607 | Deutsch - Playstation - Uncharted 2 | 2 | | 629 | Deutsch - PSP GT | 1 | | 630 | Deutsch - Playstation - Ratchet & Clank | 1 | | 631 | 61 Holdings - FireplaceMantels123 | 1 | | 634 | Yell BTs - 067-072 | 3 | | 635 | Yell BTs - 073-078 | 3 | | 636 | Yell BTs - 079-085 | 3 | | 637 | Yell BTs - 086-091 | 3 | | 638 | Yell BTs - 092-097 | 3 | | 639 | Yell BTs - 098-105 | 3 | | 640 | Yell BTs - 106-110 | 3 | | 642 | Deutsch - Playstation - Netflix Partnership | 1 | | 644 | Deutsch - PSP Assassins Creed Bundle | 1 | | 646 | Yell - Mobile | 3 | | 651 | Deutsch - PSP Little Big Planet | 2 | | 655 | Deutsch - Playstation - MAG | 1 | | 686 | Deutsch - Playstation - Heavy Rain | 1 | | 691 | Deutsch - PSN - The Tester | 1 | | 692 | Deutsch - Playstation - God of War 3 | 1 | | 703 | Deutsch - PSN - PSN Games | 1 | | 713 | Daily Candy - Swirl.com | 6 | | 717 | Deutsch - Playstation - ModNation | 1 | | 725 | Deutsch - Playstation - Greatest Hits | 1 | | 726 | Deutsch - Playstation - Metal Gear Solid PSP | 1 | | 727 | Deutsch - Playstation - PSP Brand Channel | 1 | +-----------+----------------------------------------------+-------------+ 53 rows in set (0.47 sec) == accounts with no channels == select accounts.id 'accountID', accounts.description, 0 as 'numChannels' from tsacommon.accounts left join accountChannelMap on accountID=accounts.id where isActive='true' and databaseInstance=5 and accountChannelMap.accountID is null; +-----------+---------------------------------------+-------------+ | accountID | description | numChannels | +-----------+---------------------------------------+-------------+ | 601 | Freedom Financial - Debt Relief | 0 | | 606 | Renovation Experts Display | 0 | | 620 | TSA - Global Yahoo SSP Administration | 0 | +-----------+---------------------------------------+-------------+ 3 rows in set (0.02 sec select accounts.id 'accountID', accounts.description, 0 as 'numChannels' from tsacommon.accounts left join accountChannelMap on accountID=accounts.id where isActive='true' and databaseInstance=1 and accountChannelMap.accountID is null; +-----------+--------------------------------+-------------+ | accountID | description | numChannels | +-----------+--------------------------------+-------------+ | 277 | The Search Agency Test Account | 0 | | 313 | -TSA Old Accounts | 0 | | 321 | - Select an Account - | 0 | | 322 | Lavalife ChatHerUp | 0 | +-----------+--------------------------------+-------------+ 4 rows in set (0.03 sec)