column A column b | output
10 7 | 10
5 8 | 8
7 -9 | 7
3 5 | 5
0 6 | 6

Write a sql query to print such output.

Answers were Sorted based on User's Feedback



column A column b | output 10 7 | 10 5 8 ..

Answer / apoorva garg

select a,b,
CASE WHEN (a>b) THEN a
ELSE b
END output
from a

Is This Answer Correct ?    9 Yes 0 No

column A column b | output 10 7 | 10 5 8 ..

Answer / satish tadepalli

select greatest(nvl(cola,0),nvl(colb,0)) from tablename

Is This Answer Correct ?    6 Yes 1 No

column A column b | output 10 7 | 10 5 8 ..

Answer / phani kumar

select greatest(cola,colb) from tblname;

Is This Answer Correct ?    2 Yes 0 No

column A column b | output 10 7 | 10 5 8 ..

Answer / suresh ramsng

select A,B,greatest(A,B) output from <tablename>

Is This Answer Correct ?    2 Yes 0 No

Post New Answer

More SQL PLSQL Interview Questions

cursor types? explain with example programs?

1 Answers   HP,


What does cursor do in sql?

0 Answers  


Do foreign keys improve performance?

0 Answers  


Is a foreign key always unique?

0 Answers  


Which is better join or subquery?

0 Answers  






In what condition is it good to disable a trigger?

0 Answers  


i want insert 10 records from table a to table b. if i m using statement level trigger how many record insert ?in row level trigger how many record inserted???

3 Answers   Scope International,


Explain alias in sql?

0 Answers  


How do we tune the code?

2 Answers  


Can we rollback delete command?

0 Answers  


What is a pragma statement?

0 Answers  


when is the use of update_statistics command? : Sql dba

0 Answers  


Categories