Skip to Content
Menu
This question has been flagged
1 Reply
5421 Views

I have customer reference number like

FKM200,

ABD400,

DEF100,

ABD220,etc...

I want to sort the above reference number like :

DEF100,

FKM 200,

ABD220,

ABD400, ...

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


 

Avatar
Discard

can u post your total code

Best Answer

Hi,

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.

Avatar
Discard