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



i have 2 table table one 4 columns respective values a1 7,a2 6,a3 8 ,a4 12 & table two 4 colum..

Answer / 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

More SQL PLSQL Interview Questions

SELECT ROUND(TRUNC(MOD(1600,10),-1),2) FROM dual;

10 Answers  


How write primary and foreign key relationship between two tables without using constraints? u can use any of procedure/function/trigger and any sql?

1 Answers   Parexel,


what is a materialized view? : Sql dba

0 Answers  


which operator is used in query for pattern matching? : Sql dba

0 Answers  


What is input buffer in sql*plus?

0 Answers  






How to execute multiple sql statements in a single annonymous block irrespective of the sql statement result?

2 Answers  


How consistent is the view of the data between and within multiple sessions, transactions or statements ?

0 Answers  


What is difference between cursor and ref cursor?

1 Answers  


I have 2 packages A and B. Now package A references Package B and Package B references Package A. How do you compile such inter-dependent objects in PL/SQL

5 Answers   Doyensys, Infosys, Metric Stream,


What is string data type in sql?

0 Answers  


How do I create an index in word?

0 Answers  


Explain the rollback statement?

0 Answers  


Categories