I have customer reference number like
I want to sort the above reference number like :
I have query = SELECT customer_id FROM res_partner order by CAST(SPLIT_PART(customer_id, '-', 2) AS INTEGER)"
But my function is not working.
Please help me
If your pattern is fix like first three character is alphabates and another three character is numbers then you can achieve your objective using below query.
select ref from res_partner order by substr(ref,4,3)
It will return result as you have describe into your question.
I hope it will help you.
Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!
About This Community
|Asked: 2/20/15, 7:07 AM|
|Seen: 581 times|
|Last updated: 3/16/15, 8:10 AM|