4
I have a table with columns ID
and ReqNorma
filled with a following standard:
When I perform the query to filter them, I receive values that are not in order because some of them were registered out of order:
select Id,ReqNorma
from TABLE
where Norma = 'ISO 9001'
ORDER BY ReqNorma
What would be the best way to make this ORDER BY filter to display results numerically?
wouldn’t just be ordering by id?
– rLinhares
Which one
SGBD
?– Sorack
As I understand it, you need a numerical rather than alphanumeric sorting by prefixing the string contained in the Reqnorma field. Maybe an ORDER BY left(Reqnorma, position(' in Reqnorma))::Numeric can solve, depending on the DBMS you are using. You may also need to remove the '.'.
– anonimo