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 |
Source is Sales Table: Sno Prod Sales Sales_Amount 1 A 10 2000 2 A 20 1000 3 C 10 3000 4 D 30 4000 5 A 20 1000 Target : Sales_Count T_Sales_Amt Sales_Count(A) T_Sales_Amt(A) 90 11000 50 4000 In single query, pls tell me.
What is the difference between CHAR and VARCHAR2? If VARCHAR2 serves the uses of CHAR why CHAR is still used and not been discarded yet?
1. is it possible to use the cursor atttibutes (%found ,% rowcount , %isopen , %notfound ) to our user defined cursor names ....... cursor cursor_name is select * from scott.emp if you use... cursor_name%found , %rowcount ,%isopen,%notfound...will it work... -------------------------- 2.what is the difference between the varray and index by table .. -------- 3. type type_name is table of number(8,3) index by binary_integer; identifier_name type_name; first , last , prior , next ,trim are the methods we can use it for the above type...simillary is there any way to apply for cursors... with thanks and regards..sarao...
When would you denormalize?
8 Answers MBT, Microsoft, MMU,
what is the difference between delete and truncate statement in sql? : Sql dba
Is join an inner join?
What is difference between stored function and application function?
Is delete faster than truncate?
Show the two pl/sql cursor exceptions.
What are the types pl/sql code blocks?
What is a schema sql?
What is oracle pl sql developer?
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)