Re: how... concat & group by?
> >If there is a function to sum values, why there isn't one to sum strings > >i.e. concat strings. Or how should i use it? > > You use concat to put two strings together. I know, i have read the manual. /concat('string1','string2')/, but it doesn't works with group by. >>> I would like to get this: 1user1'50 - twenty-three - the reason of life' 2user2'twenty-three - 303 rulz' 3user3'' I tried: SQL>SELECT Table1.name, ???(Table3.txt) FROM Table1 left join Table2 on Table1.uid=Table2.uid left join Table3 on Table2.c=Table3.c group by Table1.name; 1user1'50' 2user2'twenty-three' 3user3NULL What function should i use? Z - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail <[EMAIL PROTECTED]> To unsubscribe, e-mail <[EMAIL PROTECTED]> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
Re: how can i make it? concat?
> It's a bad habbit to cc to a list. Ooops. Sorry. > >Of course "left join". And "group by" moreover. But how? > >For the "group by" i need a sum-like function, which joins the strings. > > Hmmm, something like concat() you mean? > I tried it. Doesn't works. Without group by i have this set: idnamec 1user1'50' 2user1'twenty-three' 3user1'the reason of life' 4user2'twenty-three' 5user2'303 rulz' 6user3NULL I would like to get this: 1user1'50 - twenty-three - the reason of life' 2user2'twenty-three - 303 rulz' 3user3'' If there is a function to sum values, why there isn't one to sum strings i.e. concat strings. Or how should i use it? I tried: SQL>SELECT Table1.name, CONCAT(Table3.txt) FROM Table1 left join Table2 on Table1.uid=Table2.uid left join Table3 on Table2.c=Table3.c group by Table1.name; 1user1'50' 2user2'twenty-three' 3user3NULL 3 rows in set (0.00 sec) server version is 3.22.32 Z - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail <[EMAIL PROTECTED]> To unsubscribe, e-mail <[EMAIL PROTECTED]> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
Re: how can i make it?
Of course "left join". And "group by" moreover. But how? For the "group by" i need a sum-like function, which joins the strings. > >how can i get a recordset constains all records (or records matching a where > >exp.) from the Table1 with the c values from the Table2, like this: > > > >uidnamecs > >- > >1user1'50 - twenty-three - the reason of life' > >2user2'twenty-three - 303 rulz' > >3user3'' > > > >I can make heavy things with mysql, but i'm too small for this :) > > Think what you want is "left join". Check your favorite SQL manual for syntax. > - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail <[EMAIL PROTECTED]> To unsubscribe, e-mail <[EMAIL PROTECTED]> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
how can i make it?
For example i have 3 tables (really i have to make it with 6 tables, but...) So 3 tables: Table1 uid| name 1user1 2user2 3user3 Table2 iduidc 1150 2123 3142 4223 52303 Table3 idctxt 123'twenty-three' 242'the reason of life' 350'50' 4303'303 rulz' how can i get a recordset constains all records (or records matching a where exp.) from the Table1 with the c values from the Table2, like this: uidnamecs - 1user1'50 - twenty-three - the reason of life' 2user2'twenty-three - 303 rulz' 3user3'' I can make heavy things with mysql, but i'm too small for this :) thanx: Z - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail <[EMAIL PROTECTED]> To unsubscribe, e-mail <[EMAIL PROTECTED]> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
how can i make it?
For example i have 3 tables (really i have to make it with 6 tables, but...) So 3 tables: Table1 uid| name 1user1 2user2 3user3 Table2 iduidc 1150 2123 3142 4223 52303 Table3 idctxt 123'twenty-three' 242'the reason of life' 350'50' 4303'303 rulz' how can i get a recordset constains all records (or records matching a where exp.) from the Table1 with the c values from the Table2, like this: uidnamecs - 1user1'50 - twenty-three - the reason of life' 2user2'twenty-three - 303 rulz' 3user3'' I can make heavy things with mysql, but i'm too small for this :) thanx: Z - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail <[EMAIL PROTECTED]> To unsubscribe, e-mail <[EMAIL PROTECTED]> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
count distinct
I can make this query: select a from table. I can count it: select count(a) from table. I can select it: select distinct a from table. But how can i count it? select count(distinct a) from table doesn't works Z - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail <[EMAIL PROTECTED]> To unsubscribe, e-mail <[EMAIL PROTECTED]> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php