check whether all the emp numbers are indeed unique.

Answers were Sorted based on User's Feedback



check whether all the emp numbers are indeed unique...

Answer / nagendra

select empno, count(empno)
from emp
group by empno
having count(empno) > 1;

Is This Answer Correct ?    22 Yes 4 No

check whether all the emp numbers are indeed unique...

Answer / santhi kandasamy

In Oracle,

select empno from emp where empno is not null
group by empno
having count(*) >1;

if the above query does not return any rows then you can
consider, empno having unique values.

Is This Answer Correct ?    7 Yes 0 No

check whether all the emp numbers are indeed unique...

Answer / eswar

select empno,count(empno)
from emp group by empno having count(empno)>1;

Is This Answer Correct ?    1 Yes 0 No

check whether all the emp numbers are indeed unique...

Answer / suresh somayajula

in rownum we will use < or <= operators only.

If any one knows this query pls send the answer.

Is This Answer Correct ?    0 Yes 1 No

check whether all the emp numbers are indeed unique...

Answer / biswajit rout

SELECT empno,count(*) FROM emp GROUP BY empno;

Is This Answer Correct ?    0 Yes 1 No

check whether all the emp numbers are indeed unique...

Answer / valli

select rowid from (
select emp_no, rownum() over (emp_no) as Rownum
from emp order_by emp_no,sal
) where rownum > 2

If this query returns no rows then we can say all the emp
numbers are indeed unique.

Regard,
Valli

Is This Answer Correct ?    0 Yes 5 No

Post New Answer

More SQL PLSQL Interview Questions

Can we declare a column having number data type and its scale is larger than pricesionex: column_name number(10,100),column_name numbaer(10,-84)

0 Answers  


how to rename an existing table in mysql? : Sql dba

0 Answers  


How will you a activate/deactivate integrity constraints?

2 Answers  


What is cold data?

0 Answers  


Why do we use function in pl sql?

0 Answers  






Why do we use joins?

0 Answers  


what are the different type of sql's statements ? : Sql dba

0 Answers  


What are nested triggers ?

6 Answers   Amazon, Appeal Soft, IBM, Infosys, TCS,


how i do the database testing of online money transactions between two parties (client and organization). suppose our company makes a website for our client and give a extra feature of online money transaction with there clients then how i test this feature in database testing

1 Answers  


In packages the source code is compiled into p code ? how do we describe the p code

3 Answers  


What is sql stand for?

0 Answers  


What is null in pl/sql?

0 Answers  


Categories