SORT by part of filed
SORT by part of filed
(OP)
CODE
SELECT DISTINCT LISTINO_BAR.REPARTO FROM REPARTI INNER JOIN LISTINO_BAR ON REPARTI.IDREP = Val(LISTINO_BAR.REPARTO) ORDER BY LISTINO_BAR.REPARTO
but i need to sort from only a numeric value and not to the all in field LISTINO_BAR.REPARTO
note:
the numeric value are dinamic, i can have:
987-....
12-...
0-....
ecc
RE: SORT by part of filed
You have not given a specific example, so I tried this data
CODE
So I have now the table MYTAB with one column REC, which contains the following data
CODE
Now, how do I sort the table by the numeric part of the record?
Using CTE (=Common Table Expressions) I create a temporary table with additional column NUMBER, where I extract the numeric string part from the column REC using regular expression function REGEXP_SUBSTR() and convert it into integer number using CAST() , i.e.:
CODE
The result I got is this temporary table with the original column REC and additional column NUMBER:
CODE
Finally, I can sort that table by the NUMBER column:
CODE
CODE
RE: SORT by part of filed
but i cannot test now.
is for Access database?
RE: SORT by part of filed
RE: SORT by part of filed
CODE
RE: SORT by part of filed