Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


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

how do you count the duplicate records in a table

10 Answers   Tech Mahindra,


what is bcp? When is it used?

0 Answers  


What is memory optimized table?

0 Answers  


How long will it take to learn pl sql?

0 Answers  


How many postgresql users are there, worldwide?

0 Answers  


How many row comparison operators are used while working with a subquery?

0 Answers  


how to include comments in sql statements? : Sql dba

0 Answers  


How do I run sql profiler?

0 Answers  


what is Difference between Having and Where clause?

5 Answers   IBM,


How do I partition in sql?

0 Answers  


define data blocks ? : Sql dba

0 Answers  


What is a full join?

0 Answers  


Categories