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
what is the functionality of the function htmlentities? : Sql dba
Can we call dml statement in function?
What is the unique index?
Explain the steps needed to create the scheduled job?
What is a rank in sql?
Why do we need unique key in a table?
i have a column which may contain this kind of value: 123*67_80,12*8889_5,34*8_874 ,12*7_7 (can contain space before a comma, and this string length can be anything) now i want to split this value into two column like: column1: 123*67,12*8889,34*8,12*7 column2: 80,5,874,7 use function for this
What is the difference between left join and right join?
What is the difference between view and stored procedure?
What are aggregate and scalar functions?
What is trigger in pl sql?
Is sql developer case sensitive?
what is the difference between group by and order by in sql? : Sql dba
What packages are available to pl/sql developers?
Describe different types of general function used in sql?