Re: [sqlite] How to use distinct in group_concat, together with specified separator

2011-01-10 Thread smart sl
Is there any one can help?

2011/1/7 smart sl smar...@gmail.com

 In Aggregate Functions of SQLite Docs, it's said that:
 In any aggregate function that takes a single argument, that argument can
 be preceded by the keyword DISTINCT.

 Then how about two arguments circumstance when I want to use distinct and
 together with specified separator. Is there a way to do that?

 I'm using SQLite 3.7.3 in tcl. Thanks advance.

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


Re: [sqlite] How to use distinct in group_concat, together with specified separator

2011-01-10 Thread Simon Davies
On 10 January 2011 14:22, smart sl smar...@gmail.com wrote:
 Is there any one can help?

SQLite version 3.6.11
Enter .help for instructions
sqlite
sqlite create table tst( data integer );
sqlite
sqlite insert into tst values( 1 );
sqlite insert into tst values( 2 );
sqlite insert into tst values( 3 );
sqlite insert into tst values( 2 );
sqlite
sqlite select group_concat( d, '-' ) from ( select distinct data d from tst );
1-2-3
sqlite


 2011/1/7 smart sl smar...@gmail.com

 In Aggregate Functions of SQLite Docs, it's said that:
 In any aggregate function that takes a single argument, that argument can
 be preceded by the keyword DISTINCT.

 Then how about two arguments circumstance when I want to use distinct and
 together with specified separator. Is there a way to do that?

 I'm using SQLite 3.7.3 in tcl. Thanks advance.


Regards,
Simon
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] How to use distinct in group_concat, together with specified separator

2011-01-10 Thread smart sl
Thank you. It's an indirect way, and it works. Could it be the same
efficient as select group_concat(distinct data separator '-') from tst
like in mysql? I'm not quite understand the actual functionality inside, so
this is significant to me.

2011/1/10 Simon Davies simon.james.dav...@gmail.com

 On 10 January 2011 14:22, smart sl smar...@gmail.com wrote:
  Is there any one can help?

 SQLite version 3.6.11
 Enter .help for instructions
 sqlite
 sqlite create table tst( data integer );
 sqlite
 sqlite insert into tst values( 1 );
 sqlite insert into tst values( 2 );
 sqlite insert into tst values( 3 );
 sqlite insert into tst values( 2 );
 sqlite
 sqlite select group_concat( d, '-' ) from ( select distinct data d from
 tst );
 1-2-3
 sqlite

 
  2011/1/7 smart sl smar...@gmail.com
 
  In Aggregate Functions of SQLite Docs, it's said that:
  In any aggregate function that takes a single argument, that argument
 can
  be preceded by the keyword DISTINCT.
 
  Then how about two arguments circumstance when I want to use distinct
 and
  together with specified separator. Is there a way to do that?
 
  I'm using SQLite 3.7.3 in tcl. Thanks advance.
 

 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


Re: [sqlite] How to use distinct in group_concat, together with specified separator

2011-01-10 Thread Simon Davies
On 10 January 2011 15:18, smart sl smar...@gmail.com wrote:
 Thank you. It's an indirect way, and it works. Could it be the same
 efficient as select group_concat(distinct data separator '-') from tst
 like in mysql? I'm not quite understand the actual functionality inside, so
 this is significant to me.

I know nothing of the internals of MySql; but although the syntax is
different and the SQLite solution looks 'indirect', the processing
necessary to generate the result set is basically the same.



Regards,
Simon
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users