Доброго времени суток.
Есть следующий селект:
SELECT
`card_id`,
HEX(REVERSE(UNHEX(`card_id`))) AS `card_id_revers`,
IF((SELECT `card_id` REGEXP '^[0-9]+$'), (HEX(CAST(SUBSTRING(`card_id`,2) AS UNSIGNED))), NULL) AS card_id_sub_num,
IF((SELECT `card_id` REGEXP '^[0-9]+$'), (HEX(REVERSE(UNHEX(HEX(CAST(SUBSTRING(`card_id`,2) AS UNSIGNED)))))), NULL) AS card_id_sub_num_reverse,
IF((SELECT `card_id` REGEXP '^[0-9]+$'), (HEX(UNHEX(HEX(CAST(`card_id` AS UNSIGNED))))), NULL) AS card_id_num,
IF((SELECT `card_id` REGEXP '^[0-9]+$'), (HEX(REVERSE(UNHEX(HEX(CAST(`card_id` AS UNSIGNED)))))), NULL) AS card_id_num_revers
FROM `user_card`
Результат выполнения:
+------------------+------------------+-----------------+-------------------------+----------------+--------------------+
| card_id | card_id_revers | card_id_sub_num | card_id_sub_num_reverse | card_id_num | card_id_num_revers |
+------------------+------------------+-----------------+-------------------------+----------------+--------------------+
| E15A6E9B | 9B6E5AE1 | NULL | NULL | NULL | NULL |
| E2334E7B | 7B4E33E2 | NULL | NULL | NULL | NULL |
| E2786846 | 466878E2 | NULL | NULL | NULL | NULL |
| A0103449 | 493410A0 | NULL | NULL | NULL | NULL |
| 04577902B22A80 | 802AB202795704 | NULL | NULL | NULL | NULL |
| E15A6E9 | E9A6150E | NULL | NULL | NULL | NULL |
| 1222077154732672 | 7226735471072212 | C9FA5DEBAA80 | 80AAEB5DFAC9 | 04577902B22A80 | 802AB202795704 |
| 3780800155 | 5501808037 | 2E8A109B | 9B108A2E | E15A6E9B | 9B6E5AE1 |
+------------------+------------------+-----------------+-------------------------+----------------+--------------------+
Возможно ли разбить колоны с строке на несколько строк?
Например:
| 1222077154732672 | 7226735471072212 | C9FA5DEBAA80 | 80AAEB5DFAC9 | 04577902B22A80 | 802AB202795704 |
На выходе получить:
+------------------+
| card_id |
+------------------+
| 1222077154732672 |
| 7226735471072212 |
| C9FA5DEBAA80 |
| 80AAEB5DFAC9 |
| 04577902B22A80 |
| 802AB202795704 |
+------------------+
Спасибо!