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 / 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 |
Post New Answer View All Answers
mention different types of relationships in the dbms?
What does Master database contains?
What are Row versions of DataRow?
What are the common performance issues in sql server?
Explain security with sql azure?
Explain about integration services of Microsoft SQL server?
What is a heap?
What is trigger explain with program?
Do you know what is a linked server in sql server?
Define Unique Key?
what protocol both networks use? : Sql server database administration
What stored by the tempdb ? : sql server database administration
Do you know the policy based administration feature of sql server 2008?
Does partitioning help performance?
What are the basic features of a trigger in ms sql server?