title: TypeOrm ViewEntity query is incorrect
body: <p>I am following the TypeOrm documents on how to create <a href="https://typeorm.io/#/view-entities" rel="nofollow noreferrer">a ViewEntity</a> so I can generate and query a custom view of my database. However at runtime, the SQL generated is not what I expected. The docs mention that the expression fed to <code>@ViewEntity()</code> can be a query.  Here is my model:</p>
  <pre><code>@ViewEntity({
    expression: `
  SELECT t1.*, t1.CountOfA + t1.CountOfB AS Total
  FROM (
  SELECT q.CountOfA, q.CountOfB
  FROM questions q
  ) AS t1`
  })
  export class CountViewEntity {
    @ViewColumn()
    CountOfA: number;
  
    @ViewColumn()
    CountOfB: number;
  
    @ViewColumn()
    Total: number;
  }
  
  </code></pre>
  <p>So I expected that the <code>Repository&lt;CountViewEntity&gt;</code> would give me one record with CountOfA, CountOfB and Total for each row in my <code>questions</code> table.  So I execute this:</p>
  <pre><code>this.countViewRepository.find();
  </code></pre>
  <p>However the following SQL gets generated:</p>
  <blockquote>
  <p>SELECT <code>CountViewEntity</code>.<code>CountOfA</code> AS <code>CountViewEntity_CountOfA</code>, <code>CountViewEntity</code>.<code>CountOfB</code> AS <code>CountViewEntity_CountOfB</code>, <code>CountViewEntity</code>.<code>Total</code> AS <code>CountViewEntity_Total</code> FROM <code>count_view_entity</code> <code>CountViewEntity</code></p>
  </blockquote>
  <p>And I get an error about table <code>count_view_entity</code> not existing.</p>
  <p>What am I doing wrong?</p>
  <h3>Edit:</h3>
  <p>hmm... It's been a day since I put up a bounty and the answer/comment I received got me thinking: I'm a MySQL newbie as well as a TypeORM newbie so maybe I just overlooked an assumption the TypeORM docs make.  I thought that the SQL generated would query actual DB tables, but I just reread the docs, in particular this part:</p>
  <blockquote>
  <p>View entity is a class that maps to a database view</p>
  </blockquote>
  <p>It meant nothing to me before but I've just come across something called <a href="http://www.mysqltutorial.org/mysql-views-tutorial.aspx" rel="nofollow noreferrer">a Database View</a>.  Maybe I should create one first and then query against that? Feeling optimistic once again...</p>