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
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 |
Answer / anju hajela
select substr(task_number,-2) from pa_task;
| Is This Answer Correct ? | 3 Yes | 1 No |
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 |
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 |
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 |
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 |
Give the structure of the procedure ?
what is the difference between rownum pseudo column and row_number() function? : Sql dba
What are the types of records?
write a query to delete similar records in particular fields(columns) in different tables
What is clustered and nonclustered index in sql?
how to insert values like 10:10:00,30:25:00 etc.into table after insert how can i sum the above insert values to get the result as 40:35:00
How do you delete duplicates in sql query using rowid?
What programs use sql?
Is grant a ddl statement?
Where is all the data on the internet stored?
how to enter binary numbers in sql statements? : Sql dba
what are the differences among rownum, rank and dense_rank? : Sql dba
Oracle (3259)
SQL Server (4518)
MS Access (429)
MySQL (1402)
Postgre (483)
Sybase (267)
DB Architecture (141)
DB Administration (291)
DB Development (113)
SQL PLSQL (3330)
MongoDB (502)
IBM Informix (50)
Neo4j (82)
InfluxDB (0)
Apache CouchDB (44)
Firebird (5)
Database Management (1411)
Databases AllOther (288)