Many thanks Igor, that worked beautifully.  If I wanted to put the three top
meanings in one column  separated by commas, instead of three columns, is
there an easy way to do that? It would be good to have them in brackets too.
eg. (meaning 1, meaning 2, meaning 3)  

Thanks for the help,
Tim.




Igor Tandetnik wrote:
> 
> Macgyver7 <t...@buffaloriverforge.com
> select
>     (select Col1 from MyTable where Col2=ThisCol2),
>     ThisCol2,
>     (select Meaning from MyTable where Col2=ThisCol2
>      group by Meaning order by count(*) desc limit 1 offset 0),
>     (select Meaning from MyTable where Col2=ThisCol2
>      group by Meaning order by count(*) desc limit 1 offset 1),
>     (select Meaning from MyTable where Col2=ThisCol2
>      group by Meaning order by count(*) desc limit 1 offset 2),
>     (select Meaning from MyTable where Col2=ThisCol2
>      group by Meaning order by count(*) desc limit 1 offset 3),
>     (select Meaning from MyTable where Col2=ThisCol2
>      group by Meaning order by count(*) desc limit 1 offset 4)
> from (select distinct Col2 as ThisCol2 from MyTable);
> 
> -- 
> Igor Tandetnik
> 
> _______________________________________________
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
> 
> 

-- 
View this message in context: 
http://old.nabble.com/Most-Frequent-Occurrence-Problem-tp32900981p32906113.html
Sent from the SQLite mailing list archive at Nabble.com.

_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to