i want count no of values in a column i.e
enam eempno phoneno
x 1 (98765,09887,096561,87964579,156678,678900876)
that means if i select phone no from table i want to get
total count of phone numbers i.e 6

Answers were Sorted based on User's Feedback



i want count no of values in a column i.e enam eempno phoneno x 1 (98765,09887,096561,87..

Answer / kavitha nedigunta

select count(*) from(
select trim(regexp_substr(initcap(phoneno),'[^,]+',1,level)) as phoneno
from testphone
connect by level <= length(regexp_replace(phoneno,'[^,]'))+1
)a

it will work in oracle 10g on words.

Is This Answer Correct ?    6 Yes 1 No

i want count no of values in a column i.e enam eempno phoneno x 1 (98765,09887,096561,87..

Answer / sarath

select length(phoneno)-length(replace(phoneno,','))+1 as TOTALCOUNT from <tablename>

For few friends who sent count(*) I wanna say something that
Its a SINGLE (FIELD VALUE)STRING CONTAINING MULTIPLE PHONENOs

Is This Answer Correct ?    5 Yes 0 No

i want count no of values in a column i.e enam eempno phoneno x 1 (98765,09887,096561,87..

Answer / nitin vartak

select enam ,eempno , (len(phoneno) - len(replace
(phoneno,',',''))) + 1 from TableName

Is This Answer Correct ?    5 Yes 3 No

i want count no of values in a column i.e enam eempno phoneno x 1 (98765,09887,096561,87..

Answer / ajit

select name,length(replace(phno, ','))
from phno;

Is This Answer Correct ?    0 Yes 0 No

i want count no of values in a column i.e enam eempno phoneno x 1 (98765,09887,096561,87..

Answer / venkat

select count(column_name) from table_name;

if u want to count number of phone numbers then use below
from emp table

select count(phno) from emp;

Is This Answer Correct ?    3 Yes 4 No

i want count no of values in a column i.e enam eempno phoneno x 1 (98765,09887,096561,87..

Answer / rolly

select count(&a) from emp

enter the column name at run time it will give the exact
count.

I have tested it. It works.

Is This Answer Correct ?    2 Yes 4 No

i want count no of values in a column i.e enam eempno phoneno x 1 (98765,09887,096561,87..

Answer / ajmal khan

select count(column_name) from table_name;

Is This Answer Correct ?    0 Yes 3 No

i want count no of values in a column i.e enam eempno phoneno x 1 (98765,09887,096561,87..

Answer / sanjeev

select ename,empno,count(column name) from table name

Is This Answer Correct ?    0 Yes 11 No

Post New Answer

More SQL PLSQL Interview Questions

what are different types of keys in sql?

0 Answers  


What is t sql used for?

0 Answers  


Is a table valued function object?

0 Answers  


Write one update command to update seqno field of a table on the basis of row number.

4 Answers   HCL,


What is sql integrity?

0 Answers  






- Types of triggers - View - Dcl - Procedures, packages, functions - Metasolve - Can use Dcl in triggers - package case study - Cursor and its types - triggers schedule - Wrap - Why we are using fetch and for in cursor. difference?

0 Answers   CTS,


What is the importance of sqlcode and sqlerrm?

0 Answers  


How do you declare a constant?

0 Answers  


How do you modify a column in sql?

0 Answers  


The select into statement is most often used to create backup copies of tables or for archiving records?

0 Answers  


What is trigger in sql? Explain

0 Answers  


take one table is t1 and in that column name is f1 f1 column values are 200 5000 3000 7000 300 600 100 400 800 400 i want display the values asc and desc in a single output. sample output is f1.a 100 200 300 400 500 600 etc...... and f1.d is 5000 4000 3000 2000 1000 etc...

9 Answers   Zensar,


Categories