Query a Comma Separated Column

article.tags holds a comma-separated list, because somebody decided a join table was overkill.

Return every tag that appears on more than one article:

  • tag — the tag, lowercase, with surrounding whitespace removed
  • articles — how many articles carry it

Order by articles descending, then tag ascending.

The data has already drifted. Some entries have spaces around them, some differ in case, one article's list contains an empty entry, and one article has no tags at all. An empty entry is not a tag and must not appear in the result.

Expected output


tag       | articles
----------+---------
databases | 3
postgres  | 3
sql       | 2
PostgreSQL

Press Run to start the SQL engine.

SensAI
Beta
Tap the mic to stop voice mode