So I have a database of emails sent and received by our ticket system, Cherwell, version 9.3.2. It uses Microsoft SQL as a backend, we're on version 2012. I'm interested in doing cleanup on old or irrelevant emails. For instance emails 3+ years old, or notices sent to technicians saying they have a new task, or notices we send out that really have no value in retaining in full email stored in the database, as Cherwell also creates rows of plaintext for most of these emails. The table related to mail, TrebuchetMail is this size: 193,883.156 MB. 
I'm wondering if it would improve overall performance to reduce this table, as nearly every type of record in Cherwell would access this table. Granted it would only be those rows relevant to the specific record.

Okay so my question: Subject is a column that stores the subject of the email. I have a few types of Subjects identified for removal, one example is this:

```
--165765
    select count(*)
    FROM [cherwell].[dbo].[TrebuchetMail]
  where subject like 'You have an unacknowledged Task%';

```

After the `You have an unacknowledged Task` part of the subject is a number, the individual Task object's ID number. So doing a select distinct treats all 165765 rows as distinct, because they are. Can you do a wildcard with select distinct to group together similar but not exactly the same? Is there another function I could use rather than distinct? I realize it actually is distinct, but surely this problem has come up before. "select distinct Subject" query that would group together the rows where Subject is like `'You have an unacknowledged Task%'` and Subject is like `'Ticket #%Created'`. Would I always need some criteria, so maybe this is pointless because I'm going to have to look at the full results to come up with the criteria for the select distinct query anyway. 

My goal is to identify different Subjects that could be targeted for archival/removal. 

[I found a 2013 thread that was a similar question, but it had to do with dates. The asker wanted to group together rows from a log that grouped together the days, disregarding the time aspect of the log.](https://www.google.com/url?sa=t&rct=j&q=&esrc=s&source=web&cd=2&ved=0ahUKEwienoS_tJfcAhXQwFkKHQcRANkQFgg3MAE&url=https%3A%2F%2Fstackoverflow.com%2Fquestions%2F18530487%2Fselect-distinct-values-using-like&usg=AOvVaw0v-JyCoB_1_AWm7pNeZSTq) I didn't quite understand how I could translate that to work for my situation. I'd be very grateful for an explanation if that would work for me.