Can anyone tell me how to do this...
I have one table account (account_id integer) and another table user(user_id integer, state varchar, account_id integer).
The possible states for a user are 'new','active' and 'inactive'. I want to run a query to give me the following output:
account_id new_no active_no inactive_no
1 4 3 2
2 0 1 1
etc.
I'm not sure what the most efficient way to do this would be - any hints appreciated!
Thanks
I have one table account (account_id integer) and another table user(user_id integer, state varchar, account_id integer).
The possible states for a user are 'new','active' and 'inactive'. I want to run a query to give me the following output:
account_id new_no active_no inactive_no
1 4 3 2
2 0 1 1
etc.
I'm not sure what the most efficient way to do this would be - any hints appreciated!
Thanks