﻿<?xml version='1.0' encoding='UTF-8'?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>SQLServerCentral / SQL Server 7,2000 / T-SQL  / How to select count(*) where count &amp;lt; 4 / Latest Posts</title><generator>InstantForum.NET v2.9.0</generator><description>SQLServerCentral</description><link>http://www.sqlservercentral.com/Forums/</link><webMaster>notifications@sqlservercentral.com</webMaster><lastBuildDate>Wed, 19 Jun 2013 23:32:06 GMT</lastBuildDate><ttl>20</ttl><item><title>RE: How to select count(*) where count &amp;lt; 4</title><link>http://www.sqlservercentral.com/Forums/Topic403243-8-1.aspx</link><description>[quote][b]GilaMonster (12/31/2010)[/b][hr]Please note: 3 year old thread.[/quote]Heh... and a seriously wrong answer to boot!</description><pubDate>Fri, 31 Dec 2010 23:54:01 GMT</pubDate><dc:creator>Jeff Moden</dc:creator></item><item><title>RE: How to select count(*) where count &amp;lt; 4</title><link>http://www.sqlservercentral.com/Forums/Topic403243-8-1.aspx</link><description>Please note: 3 year old thread.</description><pubDate>Fri, 31 Dec 2010 08:03:55 GMT</pubDate><dc:creator>GilaMonster</dc:creator></item><item><title>RE: How to select count(*) where count &amp;lt; 4</title><link>http://www.sqlservercentral.com/Forums/Topic403243-8-1.aspx</link><description>select * from table group by ...having count(*)&amp;gt;4</description><pubDate>Fri, 31 Dec 2010 07:32:46 GMT</pubDate><dc:creator>www.robben_11</dc:creator></item><item><title>RE: How to select count(*) where count &amp;lt; 4</title><link>http://www.sqlservercentral.com/Forums/Topic403243-8-1.aspx</link><description>select * From Table group by ....having count(?)&amp;gt;(select  count(?) from Table1):w00t:</description><pubDate>Fri, 31 Dec 2010 07:31:16 GMT</pubDate><dc:creator>www.robben_11</dc:creator></item><item><title>RE: How to select count(*) where count &amp;lt; 4</title><link>http://www.sqlservercentral.com/Forums/Topic403243-8-1.aspx</link><description>To quote Homer Simpson, 'Doh!'Thanks, that's what I needed.</description><pubDate>Wed, 26 Sep 2007 16:05:04 GMT</pubDate><dc:creator>jej1216</dc:creator></item><item><title>RE: How to select count(*) where count &amp;lt; 4</title><link>http://www.sqlservercentral.com/Forums/Topic403243-8-1.aspx</link><description>your having clause just needs move after the group by statement and needs to be before the order by statement</description><pubDate>Wed, 26 Sep 2007 16:01:32 GMT</pubDate><dc:creator>Adam Angelini</dc:creator></item><item><title>How to select count(*) where count &amp;lt; 4</title><link>http://www.sqlservercentral.com/Forums/Topic403243-8-1.aspx</link><description>I can do a select count from a table, no problem:select BUSINESS_UNIT, ASSET_ID, count(*)from FS.dbo.PS_AIDgroup by BUSINESS_UNIT, ASSET_ID  order by BUSINESS_UNIT, ASSET_ID, count (*) What I cannot come up with is a way to qualify the select for rows whose count is less than 4.select BUSINESS_UNIT, ASSET_ID, count(*)from FS.dbo.PS_AID---- having count(*) &amp;lt; 4 --- this doesn't cut itgroup by BUSINESS_UNIT, ASSET_ID  order by BUSINESS_UNIT, ASSET_ID, count (*) I cannot find direction in the Help files, so I am posting here.TIA,jej1216</description><pubDate>Wed, 26 Sep 2007 15:56:37 GMT</pubDate><dc:creator>jej1216</dc:creator></item></channel></rss>