You're right about max() and group_concat() will not help you either.
You need something like this:

select max(cnt)
from (select count(*) as cnt from table_name group by SampleNum)


Pavel

On Tue, Nov 10, 2009 at 3:24 PM, Rick Ratchford
<r...@amazingaccuracy.com> wrote:
>
> Suppose you had a column called SampleNumber.
>
> And in this column, you might have...
>
> 1
> 1
> 1
> 2
> 2
> 2
> 2
> 3
> 3
> 4
> 4
> 4
> 5
> 5
> 5
> 5
>
> etc.
>
> How would you write the SQL statement that would return the maximum number
> of a sample?
>
> For example, if within the SampleNumber column, the SampleNumber 17 had more
> records (say there are 23 SampleNumber = 17 in the table, more than any
> other), you wanted to return the value 23?
>
> If I use max(SampleNum), that will return only the highest value in the
> column rather than what I want, right?
>
> Is group_concat used here?
>
>
> Thank you.
>
> Rick
>
> _______________________________________________
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to