Hi,
I'm pretty sure that's not possible in MySQL - sounds like the kind of thing
that would be way easier to write a bit of script for instead.
picky
I don't think you'll get away with using 'order' as a column name either -
I'm fairly sure it's a reserved name in MySQL.
/picky
Cheers,
Andrew
Mysql,query
-Original Message-
From: Chris Stark [mailto:[EMAIL PROTECTED]]
Sent: Thursday, 12 December 2002 18:58
To: '[EMAIL PROTECTED]'
Subject: Collective Row Concatenation
Hi,
I am having a bit of a problem with my MySQL database, and I am
hoping someone can help me out. I have a table, that currently contains 350
million rows, all of which basically contain a String (VARCHAR) of size 60
characters or less, and a bunch of other identifiers. These 350 million
chunks, if combined together properly, form about 10 million unique strings
of varying length. What I am curious about is whether there is a way for me
to put these chunks together with a query. So if my table looks like this:
mytable
--
| id | order |characters |
--
1 1 abcdefghijklmno
1 2 gadrcdassdasds
1 3 adfasdfasdffdwef
2 1 asdfeereqdfqweq
2 2 dsfeqerqerqwerqw...
3 1 qweqeotrmfnrofod...
What I would like to do is something like:
SELECT COMBINE(characters) as charcter_set FROM mytable WHERE id = 1 ORDER
BY order asc;
I know that I could simply pull the results into a temporary table, and then
use CONCAT or CONCAT_WS to combine them manually, but I would really like to
be able to combine the results on the fly, as it takes a really long time to
perform all the SQL statements I need on the 350 million row table. Maybe I
am thinking about this problem the wrong way, but if anyone has any
suggestions, please let me know.
Thanks in advance,
Chris Stark
-
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
-
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