Postgres FROM query with one of the column name
问题 As follow-up to the previous question: Count matches between multiple columns and words in a nested array I have the following query: SELECT row_number() OVER (ORDER BY t.id) AS id , t.id AS "RID" , count(DISTINCT a.ord) AS "Matches" FROM tbl t LEFT JOIN ( unnest(array_content) WITH ORDINALITY x(elem, ord) CROSS JOIN LATERAL unnest(string_to_array(elem, ',')) txt ) a ON t.description ~ a.txt OR t.additional_info ~ a.txt GROUP BY t.id; which gives me matches correctly, but now the value for