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

Explain what is raid and what are different types of raid levels?

1027


where can you add custom error messages to sql server? : Sql server administration

1124


Why we use trigger in sql server with example?

965


What is table-valued sub query?

973


What happens if null values are involved in boolean operations?

987


Explain the properties of the relational tables?

996


What are the properties of the transactions?

1119


How to create an multi-statement table-valued function?

1003


Describe in brief databases and sql server databases architecture.

1014


Explain primary key?

972


What is sql server locking?

996


How to drop existing views from a database in ms sql server?

1104


How do triggers work?

943


What is the difference between mysql and mysqli?

1206


Explain logical operators in sql server?

1111