Delete the emps whose salaries are lowest sals of their own
dept.
Answers were Sorted based on User's Feedback
Answer / raji_4u
DELETE FROM EMP E1
WHERE E1.SAL =
(SELECT MIN(SAL) FROM EMP E2
WHERE E1.DEPTNO = E2.DEPTNO
)
| Is This Answer Correct ? | 15 Yes | 3 No |
Answer / nagendra
delete from emp where sal in (select min(sal) from emp group
by deptno)
| Is This Answer Correct ? | 7 Yes | 7 No |
Answer / venkyhulk1
delete from emp where eno in
(SELECT
eno
FROM
(select eno, rank() over ( partition by dno order by
salary) rank , salary from emp) e
WHERE
e.rank=1)
vgupalli@gmail.com
| Is This Answer Correct ? | 1 Yes | 1 No |
Answer / divya chaudhry
delete from emp where (depno,nvl2(sal,sal,0)) in ( select
depno,min(nvl2(sal,sal,0)) from emp group by depno )
| Is This Answer Correct ? | 0 Yes | 3 No |
delete from emp where (deptno,nvl(comm,0)) in (select
deptno,min(nvl(comm,0)) from emp
group by deptno)
| Is This Answer Correct ? | 0 Yes | 4 No |
What is auto increment?
can we call a procedure into another procedure?If yes means how you can pass the perameters for the two procedures?
Are sql connections encrypted?
Can we use commit inside a trigger?
need to split a string into seperate values. eg. col1 col2 ---------- 100 - 'a,b,c' 200 - 'a,x,b,d,e' 300 - 'c' result: value count ------------- a - 2 b - 1 c - 2 etc.
Name Salary Abc 50000 Abc 50000 xyz 20000 find the max salary using aggregate function?
Can i use Commit inside the Trigger? Suppose i use commit what will be happy (it's complied /executed/work)
How do I run a script in sql developer?
Why stored procedure is better than query?
what is the difference between where clause and having clause? : Sql dba
Can we rollback delete command?
Are subqueries faster than joins?
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)