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 |
Can you have multiple SPs with the same name on a database?
what is “go” in t-sql? : Transact sql
How do I count rows in sql query?
Does truncate table reset auto increment?
how can we write a column values horizontal by using sql stmt; ex: select name from table_name;(actual output) a b c d require output is a b c d
5 Answers Honeywell, Interact,
What is a mutating table and a constraining table?
Is sql a backend?
Write the sql query using dual table for below output? 1 L R --- --- ---- 1 1 1 1 2 1 1 3 1 1 1 2 1 2 2 1 3 2 1 1 3 1 2 3 1 3 3 Write a query using only Dual table with out writing any pl/sql program.
Can i use Commit inside the Trigger? Suppose i use commit what will be happy (it's complied /executed/work)
What are keys in sql?
Why does sql need a server?
tell us something about heap tables. : Sql dba