Table layout
id, inactive (Boolean), name
12500, f, foo
12345, f, foo
12344, f, foo
12343, f, foo
12342, t, foo
12..., t, foo (more records)
12200, f, bar
12005, f, bar
12004, f, bar
12003, f, bar
12002, t, bar
12..., t, bar (more records)
..............(more records with different names)
Results:
- Need to group by name
- Need only inactive = f
- Need fist inactive = f, id
- Need a count of how many records, inactive = f, for each group
So from the example data above I would get the result set of:
id, inactive (Boolean), name, count
12343, f, foo, 157
12003, f, bar, 197
............. (any other names that fall into the above constraints)
Any help in the right direction would be great
try
EDIT: