Hello,

I'm working on a library OPAC system with books classified using the Library of 
Congress classification system. This takes the format of either one or two 
letters followed by some numbers, i.e. R272 or RA440 etc. What I want to do is 
split the field that holds this classification into two, one containing the 
letter portion and the other containing the number bit. So

+-------+
| Class |
+-------+
| R100  |
+-------+
| RA65  |
+-------+
| RP2   |
+-------+

Would become

+--------+--------+
| Class  | Class2 |
+--------+--------+
|   R    |   100  |
+--------+--------+
|   RA   |   65   |
+--------+--------+
|   RP   |    2   |
+--------+--------+
etc

Could this be done in MySQL? I want to do something along the lines of set 
class2 = SUBSTRING_INDEX(class,'[A-Z]',-1) but I understand this is not 
possible.

Any ideas?

Regards

Adam

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/mysql?unsub=arch...@jab.org

Reply via email to