i have 2 table table one 4 columns respective values a1
7,a2 6,a3 8 ,a4 12 & table two 4 colums respective values
a1 7,a2 6,a3 8,a4 15.if table one & table two 3 colums same
then 4th column values 1)Qes diff >5 then print 5 * diff
value 2)Que diff <5 print 5
Answer Posted / anithaletchumi
select t1.name,case when abs(t1.val-t2.val) > 5 then 5 *
abs(t1.val - t2.val) else 5 end diff from tab1 t1 join tab2 t2
on t1.name=t2.name where t1.val != t2.val
Is This Answer Correct ? | 1 Yes | 0 No |
Post New Answer View All Answers
What are types of joins?
What is orm in sql?
what are the other commands to know the structure of table using mysql commands except explain command? : Sql dba
i have 2 table table one 4 columns respective values a1 7,a2 6,a3 8 ,a4 12 & table two 4 colums respective values a1 7,a2 6,a3 8,a4 15.if table one & table two 3 colums same then 4th column values 1)Qes diff >5 then print 5 * diff value 2)Que diff <5 print 5
How can we connect an Android App to an Oracle database and use the PL/SQL procedural code?
What is the difference between distinct and unique in sql?
What is the difference between stored procedure and view?
Can I create table without primary key?
What is oracle pl sql developer?
Do ddl statements need commit?
Can we delete column in sql?
Why do we use view in sql?
Why truncate is faster than delete?
How do you sort in sql?
What is data type in sql?