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
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 |
Answer / satish tadepalli
select greatest(nvl(cola,0),nvl(colb,0)) from tablename
| Is This Answer Correct ? | 6 Yes | 1 No |
select A,B,greatest(A,B) output from <tablename>
| Is This Answer Correct ? | 2 Yes | 0 No |
How to fetch values from testtable1 that are not in testtable2 without using not keyword?
What are the methods of filing?
How can we implement rollback or commit statement in a trigger?
What is sqlca in db2?
What information is needed to connect sql*plus an oracle server?
Do we need to rebuild index after truncate?
Can we update views in sql?
What is interval partition?
What is a database trigger ? Name some usages of database trigger ?
Write a query to display the current date in sql?
Explain the uses of a database trigger?
i have xml source. xml source having lacks of records. i want extract/retrive xml source data using sql query. please tell me how to write query.
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)