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

What are the two types of cursors in pl sql?

0 Answers  


What is the maximum number of triggers,can apply to a single table?

2 Answers  


Define overloaded procedure?

0 Answers  


What are aggregate and scalar functions?

0 Answers  


How do I run a sql query in pgadmin 4?

0 Answers  






Can I learn sql in a week?

0 Answers  


Give an example of any procedure.

5 Answers   Accenture, iFlex, Wipro,


What are functions in sql?

0 Answers  


check whether all the emp numbers are indeed unique.

6 Answers  


What is the basic difference between a sql and stored procedure ?

2 Answers   L&T,


how mysql optimizes distinct? : Sql dba

0 Answers  


Give me some examples of predefined exceptions.

3 Answers  


Categories