OK, here's the question...
I have two tables, one a master and the other a detail.
The master looks like this...
ID Name
1 Kevin
2 Steve
The history table [ a very large history file] looks like this..
ID Status
1 A
1 C
1 D
1 F
1 G
2 B
2 C
I want to create a flat file that will look like this, where I need a flag to indicate whether the user has had even one instance of a status...
ID Name A_Flag B_Flag C_Flag D_Flag etc.
1 Kevin .T. .F. .F. .T.
2 Steve .F. .T. .F. .F.
I wrote a query to do this, but it involves several subqueries and outer joins and some CASE instances to look for each status. It works, but I'm curious how others would approach this. Performance of the query is important.
Thanks!
Kevin