title: Is there a way in presto/athena to get column names based on a condition and use that in group by?
body: <p>Is there a way in athena/presto to get column names based on a condition and use it in group by?</p>
  <pre><code>SHOW COLUMNS FROM {table_name}
  </code></pre>
  <p>This query gives me the column details. But I want to use only the column names in some other query. The structure of the table looks like</p>
  <pre><code>name_of_service | cost | usage_date | user_123 | user_212 | user_342 | user_5832 | ...
  </code></pre>
  <p>And so on. There are around 500 columns</p>
  <p>The use case I am looking at, looks somewhat like this -</p>
  <pre><code>SELECT SUM(cost), {column_names_which_start_with_user}
  FROM {db}
  GROUP BY cost, {column_names_which_start_with_user}
  </code></pre>
  <p>I am not in control of populating the db and there are 100s of columns whose names change every month. Is there a way to do this?</p>