SELECT
*
FROM
(
SELECT
id,
version,
@major := CAST(SUBSTRING_INDEX(version, '.', 1) AS SIGNED) AS major,
--Zuerst mittels SUBSTRING_INDEX() den major abschneiden, dann mittels SUBSTRING_INDEX() den Erstel Teil
--also den minor auslesen und mit CAST() in eine Zahl wandeln
@minor := CAST(SUBSTRING_INDEX(SUBSTRING_INDEX(version, '.', -3), '.', 1) AS SIGNED) AS minor,
@srvicep := CAST(SUBSTRING_INDEX(SUBSTRING_INDEX(version, '.', -2), '.', 1) AS SIGNED) AS srvicep,
@build := CAST(SUBSTRING_INDEX(SUBSTRING_INDEX(version, '.', -1), '.', 1) AS SIGNED) AS build,
--Zum einfachen Sortieren und vergleichen kann an diese Elemente je auf 3 Stellen aufgefüllt
--zu einem sortier und Filterbaren Versionsstring zusamensetzen
CONCAT(
LPAD(@major, 3, '0'),'.',
LPAD(@minor, 3, '0'),'.',
LPAD(@srvicep, 3, '0'),'.',
LPAD(@build, 3, '0')) AS sortable_version
FROM
--Testdaten, da ich kein Bock hatte eine Tabelle anzulegen
(SELECT 1 AS id, '1.4.3' AS version UNION SELECT 2, '1.4.23.1'
UNION SELECT 3, '1.4.23.12' UNION SELECT 4, '1.4.23.10' UNION SELECT 5, '1.4.23.7') AS releases
ORDER BY
sortable_version
) AS rel
WHERE
sortable_version BETWEEN '001.004.023' AND '001.004.023.010'