If sal is null then replace it with min(sal). Can any one
write a query for this in oracle ?

Advance Thanks

Answers were Sorted based on User's Feedback



If sal is null then replace it with min(sal). Can any one write a query for this in oracle ? Ad..

Answer / madhu

here is the query
update emp set sal =(select min(sal) from emp) where sal is null

Is This Answer Correct ?    9 Yes 0 No

If sal is null then replace it with min(sal). Can any one write a query for this in oracle ? Ad..

Answer / ramesh 9866930212

select min(decode(sal,null,(select min(sal) from emp))) sal
from emp group by empno;

Is This Answer Correct ?    4 Yes 2 No

If sal is null then replace it with min(sal). Can any one write a query for this in oracle ? Ad..

Answer / abc

update emp_test set comm=(select min(sal) from emp_test)
where comm is null;

Is This Answer Correct ?    1 Yes 0 No

If sal is null then replace it with min(sal). Can any one write a query for this in oracle ? Ad..

Answer / amol m

SELECT DECODE(w.salary,NULL,(SELECT MIN(e.salary) FROM
employees e),w.salary) FROM employees w

Is This Answer Correct ?    1 Yes 0 No

If sal is null then replace it with min(sal). Can any one write a query for this in oracle ? Ad..

Answer / priyank

select (case when sal is null then (select min(sal) from
emp) end) from emp

Is This Answer Correct ?    1 Yes 0 No

If sal is null then replace it with min(sal). Can any one write a query for this in oracle ? Ad..

Answer / eval

update emp_test set comm=(select min(sal) from emp_test)
where comm is null;

Is This Answer Correct ?    0 Yes 0 No

If sal is null then replace it with min(sal). Can any one write a query for this in oracle ? Ad..

Answer / basavan

select nvl(sal,min(sal) from <table name>

Is This Answer Correct ?    1 Yes 8 No

Post New Answer

More Informatica Interview Questions

In a table, 4 person having same salary. How to get Third person record only?

15 Answers  


What is difference macros and prompts?

2 Answers  


From where we can start or use pmcmd?

3 Answers  


The Source coloumns are A,B,C with data row1- 10,20,30 row2- 40,50,60 row3-70,80,90 and so on. In the target I want one coloumn with the following data, Coloumn-X, row1-10,row2- 20,row3-30,row4-40,row5-50 and so on. How to achieve this?

3 Answers   Cap Gemini,


After dragging the ports of 3 sources sqlserver,oracle,informix to single source qualiofier can we map these ports directly to target and how?

2 Answers  






My source data like... Empid Name 10 chandra 10 sekhar I am expecting result is Empid Ename 10 Chandrasekhar How can we solve this prob?

3 Answers   Cap Gemini,


What is standalone command task?

0 Answers  


HOW DO YOU CONNECT TO REMOTE SERVER ?

1 Answers   Patni, TCS,


I have been working in Informix-4gl for the past 2 years in an MNC company.But I'm interested to work in Business Intelligence tools. Is it possible to change the technology now? I'm really confused, please help me

1 Answers  


My source is this year 01/jun/2014 04/may/2015 09/mar/2017 my desired output is day month ye 01 jun 2014 04 may 2015 09 mar 2017 how do i acheive this

2 Answers  


Define Update Override?

1 Answers  


we have 20 records in source system, when we run for the 1st time, it should load only 10 records into the target, when you run for the second time it should load another 10 record which are not loaded. How do we do that? Can we write a SQL query in source qualifier to do it. This q' is asked in one f the interviews. Please let me know if anyone knows. Thanks

3 Answers   TCS,


Categories