Re: Weird join needs
Currently I have a query that is able to return (doing a left join): 'A', 'B', 'E' 'A', 'B', 'F' 'C', 'D', NULL But I need this: 'A', 'B', 'E,F' 'C', 'D', NULL Can SQL help me in any way here ? or do I have to do it by programming ? If you use MySQL 4.1 or later take a look at http://dev.mysql.com/doc/mysql/en/group-by-functions.html and read the part about GROUP_CONCAT()... Regards, Jigal. -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: Weird join needs
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Je ado Januaro 27 2005 08:40, Jigal van Hemert skribis: Currently I have a query that is able to return (doing a left join): 'A', 'B', 'E' 'A', 'B', 'F' 'C', 'D', NULL But I need this: 'A', 'B', 'E,F' 'C', 'D', NULL Can SQL help me in any way here ? or do I have to do it by programming ? If you use MySQL 4.1 or later take a look at http://dev.mysql.com/doc/mysql/en/group-by-functions.html and read the part about GROUP_CONCAT()... Outch! I'm running MySQL 4.0, I somehow knew that I was going to need a feature of MySQL 4.1 (it seems mysql 4.0 and 4.1 added LOT'S of good features, very nice indeed), and worts, this is going to run in a server which has MySQL 3.x :( Thanks anyway. - -- Pupeno: [EMAIL PROTECTED] - http://pupeno.com Reading Science Fiction ? http://sfreaders.com.ar -BEGIN PGP SIGNATURE- Version: GnuPG v1.2.6 (GNU/Linux) iD8DBQFB+Vh6fW48a9PWGkURAmlFAJ4zf4vln6MQIlYMnYR+wSYUd12JDACfQi5f xMGr8zhD0fcEygocp/bhxIk= =xi3T -END PGP SIGNATURE- -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Weird join needs
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 I'm in need of doing the following. I have a table, let's say, with a record like this: 1, 'A', 'B'. 2, 'C', 'D' And then I have another table with records like this: 1, 'E' 1, 'F'. Currently I have a query that is able to return (doing a left join): 'A', 'B', 'E' 'A', 'B', 'F' 'C', 'D', NULL But I need this: 'A', 'B', 'E,F' 'C', 'D', NULL Can SQL help me in any way here ? or do I have to do it by programming ? Thanks. - -- Pupeno: [EMAIL PROTECTED] - http://pupeno.com Reading Science Fiction ? http://sfreaders.com.ar -BEGIN PGP SIGNATURE- Version: GnuPG v1.2.6 (GNU/Linux) iD8DBQFB+G7ofW48a9PWGkURAssUAJwM5WJjlD6Q9cFR/JFhASIZWKZHzQCfavQa Tp5Ha1Ebk5qg5avaRGwzp14= =jScZ -END PGP SIGNATURE- -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]