select t.d from ( select N_Days d , COUNT(N_Days) ds from Tbl_Setting group by N_Days )t where t.ds=MAX(t.ds)
Msg 147, Level 15, State 1, Line 7 An aggregate may not appear in the WHERE clause unless it is in a subquery contained in a HAVING clause or a select list, and the column being aggregated is an outer reference.
select top 1 N_Days d, COUNT(N_Days) ds from Tbl_Setting group by N_Days order by ds desc;
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)