title: How to integrate SQL-Generated columns in Yii2 GridView
body: <p>To show my GridView I use this ActiveDataProvider:</p>
  <pre><code>public function search($params)
  {
    $query = PublicationsPublication::find()
      -&gt;select(['eid', 'title', 'pubdate', 'citedby', &quot;STRING_AGG(DISTINCT(CONCAT(author.authid, ' - ', authname)), ', ') AS authors&quot;])
      -&gt;joinWith('publicationsAuthor')
      -&gt;groupBy(['eid','title','pubdate','citedby']);
  
    $dataProvider = new ActiveDataProvider([
      'query' =&gt; $query,
    ]);
    $this-&gt;load($params);
    if (!$this-&gt;validate()) {
      return $dataProvider;
    }
    ...
  }
  </code></pre>
  <p>I can't figure out how to use the column generated by the STRING_AGG() function in the Gridview.<br><br>
  Just in case is needed, the publicationsAuthor relation is coded this way:</p>
  <pre><code>public function getPublicationsAuthor() {
    return $this-&gt;hasMany(PublicationsAuthor::className(), ['authid' =&gt; 'authid'])
      -&gt;viaTable('publications.pub_author', ['pubid' =&gt; 'id']);
  }
  </code></pre>
  <p>I need to use the STRING_AGG() function because I want to show many authors in one cell of the Gridview. <br><br>
  I tried to use the &quot;authors&quot; column in this way:</p>
  <pre><code>$gridColumns = [
    [
      'class' =&gt; 'kartik\grid\SerialColumn',
      'width' =&gt; '20px',
    ],
    'eid',
    'title',
    'pubdate',
    'citedby',
    'authors',
  ];
  echo GridView::widget([
    'dataProvider' =&gt; $dataProvider,
    'filterModel' =&gt; $searchModel,
    'columns' =&gt; $gridColumns,
    'pager' =&gt; [
      'firstPageLabel' =&gt; 'First',
      'lastPageLabel'  =&gt; 'Last'
    ],
    ...
  ]);
  </code></pre>
  <p>But unfortunately it didn't work. In the Grid all the values are set to &quot;not set&quot;. The query works great because I tested it in PgAdmin.</p>