Cool, thank you! This works perfect... Now I have to disect it and figure
this syntax out more... Thanks to all for the education!



-Joe

On Wed, Feb 16, 2011 at 5:15 PM, Simon Davies
<simon.james.dav...@gmail.com>wrote:

> On 16 February 2011 23:00, Joe Bennett <jammer10...@gmail.com> wrote:
> > OK, this looks like it concatenated Column_1 and Column_2 and returns the
> > count of the new unique concatenated pair? What I am looking for (and I
> > apologize for not being clear) is a list of the unique values (Column
> > 1 and 2 appended) and their count... I'll try to demonstrate the expected
> > example from the table example I gave below:
> >
> > *Result*        *Count(result)*
> >
> > Value A       2
> > Value B       1
> > Value C       2
> > Value D       2
> > Value E       1
> >
>
> SQLite version 3.4.2
> Enter ".help" for instructions
> sqlite>
> sqlite> create table tst( c1 integer, c2 integer );
> sqlite> insert into tst values( 1, 3 );
> sqlite> insert into tst values( 2, 1 );
> sqlite> insert into tst values( 3, 4 );
> sqlite> insert into tst values( 4, 5 );
> sqlite>
> sqlite> select val, count( val ) from  ( select c1 as val from tst
> union all select c2 from tst ) group by val;
> 1|2
> 2|1
> 3|2
> 4|2
> 5|1
> sqlite>
>
> Regards,
> Simon
>  _______________________________________________
> 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