how to select alphabets in a one column , for this the
table name is PA_TASKS and column name is TASK_NUMBER, In
TASK_NUMBER the data like this
1.1.3NN,1.1.4NN,1.5.1NN,1.3.2NE,1.5NN,1NN,1.2NE,1CE , For
this i need to disply output as NN,NN,NN,NE,NN,NN,NE,CE,
Its some urgent requirement ,thanks in advance

Answers were Sorted based on User's Feedback



how to select alphabets in a one column , for this the table name is PA_TASKS and column name is ..

Answer / hitendra yadav

Dear friend
,
you can use this select statement:-

select trim(translate(TASK_NUMBER,'.0123456789',' ')) from
PA_TASKS;
For example:-
select trim(translate('1.1.3NN','.0123456789',' ')) from
dual;

it will give NN as output

if value format same like this then you can use substr
function also for it like this:-
select substr(TASK_NUMBER,-2) from PA_TASKS ;
For example:-

select substr('1.1.3NN',-2) from dual;

it will give NN as answer.

Is This Answer Correct ?    8 Yes 0 No

how to select alphabets in a one column , for this the table name is PA_TASKS and column name is ..

Answer / anju hajela

select substr(task_number,-2) from pa_task;

Is This Answer Correct ?    3 Yes 1 No

how to select alphabets in a one column , for this the table name is PA_TASKS and column name is ..

Answer / vinay singh

select * from PA_TASKS pp
where pp.TASK_NUMBER in
(select QQ.TASK_NUMBER from PA_TASKS QQ
where length(trim(translate
(QQ.TASK_NUMBER,'0123456789',' '))) > 0
)

Is This Answer Correct ?    0 Yes 0 No

how to select alphabets in a one column , for this the table name is PA_TASKS and column name is ..

Answer / sumathy

Create table PA_TASKS ( TASK_NUMBER nvarchar (30))

Insert into PA_TASKS values ('1.1.3NN')
Insert into PA_TASKS values ('1.1.4NN')
Insert into PA_TASKS values ('1.5.1NN')
Insert into PA_TASKS values ('1.3.2NE')
Insert into PA_TASKS values ('1.5NN')
Insert into PA_TASKS values ('1NN')
Insert into PA_TASKS values ('1.2NE')
Insert into PA_TASKS values ('1CE')

Select reverse( substring(reverse (TASK_NUMBER),1,2)) from
PA_TASKS

Is This Answer Correct ?    0 Yes 0 No

how to select alphabets in a one column , for this the table name is PA_TASKS and column name is ..

Answer / chandu

by using sub_str fuction we can do this

select sub_str(task_number,6) from pa_tasks.

Is This Answer Correct ?    0 Yes 1 No

how to select alphabets in a one column , for this the table name is PA_TASKS and column name is ..

Answer / samiksha

In SQl Sever the query would be:

select substring (reverse(task_number),1, 2) from task

Is This Answer Correct ?    1 Yes 2 No

Post New Answer

More SQL PLSQL Interview Questions

How can you maintain the integrity of your database on instances where deleting an element in a table result in the deletion of the element(s) within another table?

0 Answers  


In table a 1lakh data is present,in table b 20 thousand data is present, to get unique data from table a and b which join to be considered. whether right outer join or left inner join. 

2 Answers   GE,


what is msql? : Sql dba

0 Answers  


How to convert comma separated string to array in pl/sql?

0 Answers  


Two Methods of retrieving SQL?

7 Answers   Atiric Software, Microsoft, Oracle, TCS, Wipro,






i declare 4 procedure in package specification but in package body i write only 3 procedure. is it complie??//w

4 Answers   Scope International,


what is the difference between cursor FETCH and FOR LOOP ?

3 Answers   CG-VAK, Tech Mahindra,


What is the difference between cross join and natural join?

0 Answers  


can i write pl/sql code in a package

2 Answers  


What is Overloading of procedures ?

2 Answers  


Can one improve the performance of sql*loader? : aql loader

0 Answers  


What is the maximum size of sqlite database?

0 Answers  


Categories