Sorry, saw me mentioned here before but then I couldn't find the comment so I thought it was deleted, but it's just that the diff became invalid.

You can't use `prepare` here because it is only for preparing values, not MySQL identifiers. In other words, the above statement:

```php
$wpdb->prepare(
    "SELECT %s FROM {$wpdb->streamcontext} GROUP BY %s",
    $column,
    $column
);
```

Would produce the string:

```
SELECT "foo" FROM wp_streamcontext GROUP BY "foo"
```

Which first of all would select the string "foo" and not the column of that name, and then "foo" isn't something which can be grouped by, AFAIK.

So `prepare` is not appropriate for this purpose.