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
 General SQL Server Forums
 New to SQL Server Programming
 In in SQl

Author  Topic 

phanicrn
Starting Member

42 Posts

Posted - 2007-10-05 : 16:03:19
Hi

Our business logic,
1)we want to find the member who has done cashwithdrawl

2) if he has done caswithdrawal either with debit card or no debit card. for this we r using channel table..column as channel and we have relatioship with fact table..

so firt sql gives mem member_count of caswithdrawal, now i need help in sql, I have another condition, how many members are using debit card. I want the member count.


select Saturday_Visits,count(DISTINCT member_key) as member_count
from EDW.Transaction_Fact_Sales_Service a, EDW.VW_Transaction_Code b
where a. Transaction_Code_Key = b.Transaction_code_Key
and B.Transaction_Description ='CASH WITHDRAWAL'
GROUP BY Saturday_Visits

Result
Saturday_visits, Member_count

1 - 3 12746
11 - 15 258
16 - 20 70
21 - 25 28
4 - 5 839


Thanks
Phani

rrb
SQLTeam Poet Laureate

1479 Posts

Posted - 2007-10-12 : 00:09:16
Hi Phani

Sorry, but its not clear how you can tell whether the transaction was on a card or not, could you post some descriptions of your tables - ie the column names at least and pref the relationships between these.

--
I'm not schooled in the science of human factors, but I suspect that surprise is not an element of a robust user interface.
Go to Top of Page
   

- Advertisement -