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

Answers were Sorted based on User's Feedback



I have Two table First have UserName and second is address, in address table more than value relega..

Answer / arun

use Coalesec(addrress1,address2)

Is This Answer Correct ?    6 Yes 1 No

I have Two table First have UserName and second is address, in address table more than value relega..

Answer / krishan

Please solve my problem?

Is This Answer Correct ?    4 Yes 1 No

I have Two table First have UserName and second is address, in address table more than value relega..

Answer / manoj pandey

select user_name, coalesce(address1, address2) as address
from username u
left join address a
on u.userid = a.userid


For more Interview Questions check my blog: http://sqlwithmanoj.wordpress.com/interview-questions/

Is This Answer Correct ?    3 Yes 0 No

I have Two table First have UserName and second is address, in address table more than value relega..

Answer / 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

More SQL Server Interview Questions

How to call a function from a stored procedure in SQL Server ?

0 Answers   HCL,


What are the advantages of user defined function?

0 Answers  


do you know how to configure db2 side of the application? : Sql server database administration

0 Answers  


Does index slows down insert statements?

0 Answers  


Is BCNF better than 2NF & 3NF? Why?

0 Answers   Akamai Technologies,






How to generate create table script on an existing table in ms sql server?

0 Answers  


Define normalisation?

0 Answers  


What is the difference between locking and multi-versioning?

0 Answers  


Explain what is “asynchronous” communication in sql server service broker?

0 Answers  


How do I find sql server instance name?

0 Answers  


Can sql server be linked with other servers like oracle?

0 Answers  


What is split brain scenario in DB mirroring?

1 Answers  


Categories