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
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 |
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 |
How to call a function from a stored procedure in SQL Server ?
What are the advantages of user defined function?
do you know how to configure db2 side of the application? : Sql server database administration
Does index slows down insert statements?
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?
Define normalisation?
What is the difference between locking and multi-versioning?
Explain what is “asynchronous” communication in sql server service broker?
How do I find sql server instance name?
Can sql server be linked with other servers like oracle?
What is split brain scenario in DB mirroring?