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.
Author |
Topic |
fjudzon
Starting Member
19 Posts |
Posted - 2010-08-06 : 16:29:58
|
Hi, I have 3 tablesuser, phone and UserXPhonesat UserXPhones table, I have a field phoneType.A user could have N phones.I need to get the Home Phone Type of a given user and if he doesnt have a Home Phone, get the Office Phone.How could I do that? |
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
fjudzon
Starting Member
19 Posts |
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
fjudzon
Starting Member
19 Posts |
Posted - 2010-08-06 : 17:01:18
|
User 1Table: UserXPhonesUser 1 | Phone 1 | Phone Type 1User 1 | Phone 2 | Phone Type 5User 1 | Phone 3 | Phone Type 7I want to get the User data (besides the phone data) and the phone data for Phone Type = 5 . If there is no Phone Type =5 for him, get Phone Type =1. If no Phone Type = 1, dont return any phone data.thanks! |
 |
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
|
|
|
|
|