title: PostgreSQL - Select all records from table knowing records id from another and display additional columns
body: <p>At the beggining I'd like to say that I'm not sure about the topic's name so if anyone have suggestion to improve it, please type your suggestions.</p>
  
  <p>Here are my SQL queries to create a DB's structure exactly as mine: </p>
  
  <pre><code>CREATE TABLE display_campaign (
      files_id integer[] DEFAULT '{-1}' NOT NULL,
      campaign_id integer NOT NULL,
      files_display_length integer[] DEFAULT '{-1}' NOT NULL
  )
  
  CREATE TABLE display_files (
      file_id integer NOT NULL,
      files_source text NOT NULL,
      files_display_name text NOT NULL
  )
  </code></pre>
  
  <p>I've created a query that selects for me files from "display_files" table based on "files_id" FROM "display_campaign" based on "campaign_id"</p>
  
  <pre><code>SELECT * FROM "display_files" WHERE array["file_id"] &amp;&amp; ANY( SELECT "files_id" FROM "display_campaigns" WHERE "campaign_id" = '1')
  </code></pre>
  
  <p>Example result table looks like</p>
  
  <pre><code>file_id |   file_source   | file_display_name
  --------+-----------------+------------------
         1| {PLAYLIST}/1.mp4|              ADV1
         3| {PLAYLIST}/2.mp4|              ADV2
  </code></pre>
  
  <p>I'd like that to be like that:</p>
  
  <pre><code>file_id |   file_source   | file_display_name|file_display_length
  --------+-----------------+------------------+-------------------
         1| {PLAYLIST}/1.mp4|              ADV1|              10000
         3| {PLAYLIST}/2.mp4|              ADV2|              17000
  </code></pre>
  
  <p>Any suggestions?</p>
  
  <p>@Edit:
  files_id and files_display_length indexes are the same. It means that files_display_length[0] is property for files_id[0] etc.</p>