Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

Can we use rowid as primary key?

965


Write a query to display the current date in sql?

1002


How to create an array in pl/sql?

1052


What is lexical units in pl sql?

1118


What does a pl/sql package consist of?

959


What is using in sql?

1060


what does it mean to have quoted_identifier on? : Sql dba

1129


What is difference between hql and sql?

1052


How is data stored in sql?

1040


How does sql store data?

890


What are the conditions an underlying table must satisfy before a cursor can be used by a positioned update or delete statement? : Transact sql

977


GLOBAL TEMPORARY TABLE over Views in advantages insolving mutating error?

3034


Why do we need a foreign key?

1073


what is an alias command? : Sql dba

1073


How do I view a view in sql?

936