 <p>You cannot use Image datatype in Group by clause.</p> <p><a href="https://msdn.microsoft.com/en-us/library/ms177673.aspx" rel="nofollow">MSDN</a> says:</p> <blockquote> <p>Columns of type text, ntext, <strong>and image</strong> cannot be used in group_by_expression.</p> </blockquote> <p>You can try like this by CAST<em>ing</em> it to VARBINARY like</p> <pre><code>select pc.categoryName, pc.Short_Desc, CAST(pc.categoryImage as Varbinary), COUNT(p.categoryCodeId)as Total from tbl_product as p, tbl_productCategory as pc where p.categoryCodeId=pc.categoryCodeId group by p.categoryCodeId, pc.categoryName,pc.Short_Desc, CAST(pc.categoryImage as Varbinary) order by pc.categoryName </code></pre>