콘텐츠로 건너뛰기
메뉴
커뮤니티에 참여하려면 회원 가입을 하시기 바랍니다.
신고된 질문입니다
1 회신
5534 화면

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


 

아바타
취소

can u post your total code

베스트 답변

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.

아바타
취소