Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 Get result for only one user

Author  Topic 

baburk
Posting Yak Master

108 Posts

Posted - 2008-11-14 : 06:56:57
Hi,

Iam having a requirement that

1. I want to get the result for any(only)one user if both of them available in the Address table.

2. If only a user availble in 2 users then get the result for the user available in the Address table.

how can I able to write it in a query.

Table

UserID UserName
1 babu
2 ram
3 krishna
4 leela
5 revathi

Address

AddressID UserID
100 1
101 2
102 3
103 5
104 1
105 3

Thanks in advance.


Thanks in advance.

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-11-14 : 07:13:23
didnt get what you're asking for. can you illustrate it by giving sample output out of data posted.
Go to Top of Page

baburk
Posting Yak Master

108 Posts

Posted - 2008-11-14 : 07:30:56
Hi,

if 2 users having the AddressID in the Address table return result for only one user.

if only an user having AddressID in the Address table return result for that user.

Bye.
Go to Top of Page
   

- Advertisement -