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
Can we use rowid as primary key?
Write a query to display the current date in sql?
How to create an array in pl/sql?
What is lexical units in pl sql?
What does a pl/sql package consist of?
What is using in sql?
what does it mean to have quoted_identifier on? : Sql dba
What is difference between hql and sql?
How is data stored in sql?
How does sql store data?
What are the conditions an underlying table must satisfy before a cursor can be used by a positioned update or delete statement? : Transact sql
GLOBAL TEMPORARY TABLE over Views in advantages insolving mutating error?
Why do we need a foreign key?
what is an alias command? : Sql dba
How do I view a view in sql?