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

Explain unique key in sql.

0 Answers  


how to concatenate two character strings? : Sql dba

0 Answers  


Can you have multiple SPs with the same name on a database?

2 Answers   CGI, Quest,


What is difference between TRUNCATE & DELETE?

16 Answers   Ahn Infotech, CitiGroup, ICICI, PreVator, Saama Tech, SkyTech, TCS,


What are pl/sql cursors?

0 Answers  






What are the Diff B/W Cursor and REF Cursor

3 Answers   CTS,


Why truncate is faster than delete?

0 Answers  


Which join is default?

0 Answers  


how can we destroy the session, how can we unset the variable of a session? : Sql dba

0 Answers  


What is the difference between syntax error and runtime error?

0 Answers  


Does sql require a server?

0 Answers  


what is unique key constraint? : Sql dba

0 Answers  


Categories