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


Please Help Members By Posting Answers For Below Questions

What are types of joins?

532


What is orm in sql?

533


what are the other commands to know the structure of table using mysql commands except explain command? : Sql dba

551


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

3196


How can we connect an Android App to an Oracle database and use the PL/SQL procedural code?

582






What is the difference between distinct and unique in sql?

468


What is the difference between stored procedure and view?

526


Can I create table without primary key?

527


What is oracle pl sql developer?

530


Do ddl statements need commit?

535


Can we delete column in sql?

559


Why do we use view in sql?

533


Why truncate is faster than delete?

558


How do you sort in sql?

600


What is data type in sql?

554