Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

query

Taj.Dec 14 2010 — edited Dec 14 2010
dear all,

there is a table called TEST
in that there is a field called UNIT data type is varchar2(30)
SQL> desc TEST
-----------------------
UNIT varchar2(30) (datatype)


the field value is like below

MM-XX-11
MM-YY-11
AA-BB-XXX
AA/BB-XX-000

now my query is i want to retrieve result as below

MM
MM
AA
AA/BB 

means return only value which is before first '-'.

Comments

Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Jan 11 2011
Added on Dec 14 2010
3 comments
351 views