Thanks for the tip. I am looking at just making 16 separate queries.
It will be easier to manage and faster to run.
Dan
On Sep 6, 2008, at 9:37 PM, Brent Baisley <[EMAIL PROTECTED]> wrote:
Well, for your simple example, you can use query variables to add
the "counters".
SET @cntr:=0, @last
Well, for your simple example, you can use query variables to add the
"counters".
SET @cntr:=0, @lastVal:='A'
INSERT INTO tableB LOC,DATA SELECT CONCAT(LOC,
CONCAT( IF(@lastVal=LOC, @cntr:[EMAIL PROTECTED], @cntr:=0),
IF(@lastVal:=LOC,'',''))) LOC, CONCAT(DATA, @cntr) FROM tableA ORDER
BY
I have an existing data set - here is an example (the real one is more
complex than this)
LOC DATA
-
A 1
B 2
C 3
D 4
E 5
F 6
...
and I am looking to run some sort of INSERT ... SELECT on this to make
a new table like this:
LOC DATA