Odoo Help


This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.


How to split a character field value in sql query?

on 4/23/15, 3:24 AM 615 views

Hi Friends,

How to split a character which is separated by (:) operator like OUT/1234: SO/14-15/345.I need output as SO/14-15/345 by only using sql query.Please help me in this situation.Thanks in advance.



| 5 4 7
Bikaner, India

OpenERP Devloper at SunARC Technology

On 4/23/15, 5:13 AM

select substring(column_name, position(':' in column_name)+1, length(column_name)) from table_name 


Mohit Kotak (MK)
On 5/29/15, 9:50 AM

Hello vadivel,

Try this query.

select *,

substring(dat,1,charindex('-',dat)-1) as Section,

substring(dat,charindex('-',dat)+1,charindex('-',dat)-1) as TownShip,

reverse(substring(reverse(dat),0,charindex('-',reverse(dat)))) as myRange

from myTable;

I hope it's work.

Thank you.

Your Answer

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

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)


Asked: 4/23/15, 3:24 AM
Seen: 615 times
Last updated: 5/29/15, 9:50 AM