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 you can copy a file to file content and file to pl/sql table in advance pl/sql?
What is the use of count (*) in sql?
Do foreign keys improve performance?
Explain locks? : Transact sql
What is data types in sql?
What is sql table?
Is sql a scripting language?
which types of join is used in sql widely? : Sql dba
What are analytic functions in sql?
Explain two easy sql optimizations.
If i can use sys.check_constraints to display my constraints from my database using sql server 2005, how can i display then if i am using sql server 2000????
i hv 30 rows with date.ex:1month hav 4 weeks i want 1st day of the every week.write the qry for that.example jan has 4 weeks i need 1st dd for evry wk
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)