check whether all the emp numbers are indeed unique.
Answers were Sorted based on User's Feedback
Answer / nagendra
select empno, count(empno)
from emp
group by empno
having count(empno) > 1;
Is This Answer Correct ? | 22 Yes | 4 No |
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 |
Answer / eswar
select empno,count(empno)
from emp group by empno having count(empno)>1;
Is This Answer Correct ? | 1 Yes | 0 No |
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 |
Answer / biswajit rout
SELECT empno,count(*) FROM emp GROUP BY empno;
Is This Answer Correct ? | 0 Yes | 1 No |
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 |
How can I delete duplicate rows?
What is sql trigger example?
Does group by remove duplicates?
Why you are not able to create a table using select command,if it is having a LONG column? for eg:create table test as select * from test1 here test1 containg a column having LONG datatype...
How would you go about increasing the buffer cache hit ratio? 0. Explain the difference between a hot backup and a cold backup and the benefits associated with each 1. You have just had to restore from backup and do not have any control files. How would you go about bringing up this database? 2. How do you switch from an init.ora file to a spfile? 3. Explain the difference between a data block, an extent and a segment. 4. Give two examples of how you might determine the structure of the table DEPT. 5. Where would you look for errors from the database engine? 6. Compare and contrast TRUNCATE and DELETE for a table. 7. Give the reasoning behind using an index. 8. Give the two types of tables involved in producing a star schema and the type of data they hold. 9. What type of index should you use on a fact table? 10. Give two examples of referential integrity constraints. 11. A table is classified as a parent table and you want to drop and re-create it. How would you do this without affecting the children tables? 12. Explain the difference between ARCHIVELOG mode and NOARCHIVELOG mode and the benefits and disadvantages to each. 13. What command would you use to create a backup control file? 14. Give the stages of instance startup to a usable state where normal users may access it. 15. What column differentiates the V$ views to the GV$ views and how? 16. How would you go about generating an EXPLAIN plan?
What are procedures used for?
How do I edit a trigger in sql developer?
Is sql free?
What is oracle sql developer?
What company owns postgresql?
What is a sql select statement?
What is the difference between a primary key and a unique key?