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 Two table First have UserName and second is address,
in address table more than value relegated to UserName
table, i want to fetch 2nd address if exist other wise 1st
address access

Answer Posted / sayali

Select u.name,coalesce(a.address2, a.address1)as Address
from Username u left join address a
on u.userid = a.userid

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is partition, how will you implement it? : sql server analysis services, ssas

1099


Why we should not use triggers?

1014


What is NOT NULL Constraint in sql server 2012?

1045


How to test subquery results with the exists operator?

1163


What is scrollable cursor?

1080


If you lose rights to your sql server instance what are the options to connect to sql server instance? : sql server security

1104


What options are available to audit login activity? : sql server security

1199


How do I know if localdb is running?

999


Explain error handling in ssis?

1070


What is the difference between ddl and dml?

1097


What are the character string functions supported by sql server 2005?

1074


Explain transaction server explicit transaction?

971


How to convert a numeric expression from one data type to another?

1091


What is a join in sql?

1155


Are there any preferred steps that need to be taken care of before starting the installation of sql server 2000?

1030