Turn a column of IDs into a quoted list for a query

A column copied from a spreadsheet becomes 'a', 'b', 'c' for the IN ( ) of a database query, without doubles or stray spaces.

The steps

  1. Take out the doubles. Each ID stays once. Remove duplicate lines
  2. Trim the spaces. Spaces before and after each ID go. Trim whitespace
  3. Add quotes and commas. Copy the list into your query. Add quotes and commas to list

A quoted, comma-separated list.