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 |
rv498
Yak Posting Veteran
60 Posts |
Posted - 2014-03-03 : 18:53:56
|
Use a subquery and the EXISTS predicate to find customers that respond to surveys. List full name and email address. -- Try the CONCAT() function for the name.-- 1656 rowsSELECT CONCAT(C.LastName,', ',C.FirstName,C.MiddleName), C.EmailAddressFROM dbo.DimCustomer AS CWHERE EXISTS (SELECT SurveyResponseKey FROM dbo.FactSurveyResponse WHERE dbo.DimCustomer.CustomerKey = CustomerKey)This is my first attempt at EXISTS AND so far it doesn't work. Any help would be greatly appreciated. |
|
bitsmed
Aged Yak Warrior
545 Posts |
Posted - 2014-03-03 : 19:01:04
|
quote: Originally posted by rv498 Use a subquery and the EXISTS predicate to find customers that respond to surveys. List full name and email address. -- Try the CONCAT() function for the name.-- 1656 rowsSELECT CONCAT(C.LastName,', ',C.FirstName,C.MiddleName), C.EmailAddressFROM dbo.DimCustomer AS CWHERE EXISTS (SELECT SurveyResponseKey FROM dbo.FactSurveyResponse WHERE dbo.DimCustomerFactSurveyResponse.CustomerKey = C.CustomerKey)This is my first attempt at EXISTS AND so far it doesn't work. Any help would be greatly appreciated.
|
|
|
rv498
Yak Posting Veteran
60 Posts |
Posted - 2014-03-04 : 00:08:21
|
Thanks bitsmed, I see I didn't catch that. |
|
|
|
|
|