dang, MySQL indexes from 1 instead of 0 on strings....
ok, this works... look at the transcripts
update s2j2_sync_exception
set username=
CONCAT(
TRIM(SUBSTRING(lastnamefirst,LOCATE(',' , lastnamefirst) + 1, LENGTH(lastnamefirst) - LOCATE(',' , lastnamefirst) )),
"_",
TRIM(SUBSTRING(lastnamefirst,1, LOCATE(',' , lastnamefirst) - 1))
);
mysql> select username, lastnamefirst from s2j2_sync_exception ;
+-------------------+--------------------+
| username | lastnamefirst |
+-------------------+--------------------+
| Jon_Andreas | Andreas, Jon |
| James_Arquitola | Arquitola, James |
| Scott_Brosious | Brosious, Scott |
| Kris_Burlingame | Burlingame, Kris |
| Joseph_Dahl | Dahl, Joseph |
| Bruce_Dichter | Dichter, Bruce |
| Judy_Henry | Henry, Judy |
| Jessie_Laraux | Laraux, Jessie |
| Cathlina_Martinez | Martinez, Cathlina |
| Ernest_Medeiros | Medeiros, Ernest |
+-------------------+--------------------+
10 rows in set (0.00 sec)
ok, this works... look at the transcripts
update s2j2_sync_exception
set username=
CONCAT(
TRIM(SUBSTRING(lastnamefirst,LOCATE(',' , lastnamefirst) + 1, LENGTH(lastnamefirst) - LOCATE(',' , lastnamefirst) )),
"_",
TRIM(SUBSTRING(lastnamefirst,1, LOCATE(',' , lastnamefirst) - 1))
);
mysql> select username, lastnamefirst from s2j2_sync_exception ;
+-------------------+--------------------+
| username | lastnamefirst |
+-------------------+--------------------+
| Jon_Andreas | Andreas, Jon |
| James_Arquitola | Arquitola, James |
| Scott_Brosious | Brosious, Scott |
| Kris_Burlingame | Burlingame, Kris |
| Joseph_Dahl | Dahl, Joseph |
| Bruce_Dichter | Dichter, Bruce |
| Judy_Henry | Henry, Judy |
| Jessie_Laraux | Laraux, Jessie |
| Cathlina_Martinez | Martinez, Cathlina |
| Ernest_Medeiros | Medeiros, Ernest |
+-------------------+--------------------+
10 rows in set (0.00 sec)