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

what is rollback? : Sql dba

0 Answers  


hi..........i m Accenture employee...Accenture is an IT company having itz branches in India at Mumbai, Pune,Delhi, Hyderabad, Chennai and Bangalore....Presently there are openings here for SAP, Testing, Oracle,Java,.NET,MAinframe and Peoplesoft...... I am a software engineer working with Accenture,Mumbai....u can mail me in your resume..i`ll forward it to our HR team...my mail id: pankit.lodaya@accenture.com

8 Answers   Wipro,


what is the different between now() and current_date()? : Sql dba

0 Answers  


What is the difference between an inner join and an outer join?

0 Answers  


what is global table

7 Answers   iFlex,






What is meant by Join? What are the different types of Joins available? Explain.

5 Answers   Cap Gemini,


What is the difference between stored procedure and view?

0 Answers  


Why procedure is used in sql?

0 Answers  


How does stored procedure reduce network traffic?

0 Answers  


what are string data types? : Sql dba

0 Answers  


what is meant by forward declaration in functions?

4 Answers   TCS,


What are few of the schema objects that are created using PL/SQL?

0 Answers  


Categories