Odoo Help

0

How to split a character field value in sql query?

By
vadivel
on 4/23/15, 3:24 AM 932 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.

0
Prakash
On 4/23/15, 5:13 AM

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

 

0
Mohit Kotak
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.


About This Community

This platform 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.

Register

Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

1 follower(s)

Stats

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