I’m trying to sort on a part of string as integer by CAST(pid AS SIGNED) with no success.
I think I need something like this pseudocode: CAST ON REGX('^islandora(/d?)$') OF pid AS SIGNED
doFields table has following structure:
+---------------+--------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+---------------+--------------+------+-----+---------+-------+
| pid | varchar(64) | NO | MUL | NULL | |
| ownerId | varchar(255) | YES | | NULL | |
+---------------+--------------+------+-----+---------+-------+
here is sample data:
+----------------+---------+
| pid | ownerId |
+----------------+---------+
| islandora:1050 | 8 |
| islandora:1052 | 8 |
| islandora:1053 | 8 |
| islandora:1054 | 8 |
| islandora:1055 | 8 |
+----------------+---------+
Try to use this ORDER BY –