title: Syntax error while creating view for oracle
body: <p>My query:</p>
  
  <pre><code>CREATE VIEW SOME_VIEW2 AS 
  (
    SELECT to_char(tbl_albums.album), COUNT(tbl_songs.id) AS "Songs in album"
    FROM tbl_songs 
    LEFT JOIN tbl_albums 
    ON tbl_songs.album_id = tbl_albums.id
    LEFT JOIN tbl_bands
    ON tbl_albums.band_id = tbl_bands.id
    WHERE to_char(LOWER(TRIM(tbl_bands.band))) = 'metallica'
    GROUP BY to_char(tbl_albums.album)
  );
  </code></pre>
  
  <p>Error I got:</p>
  
  <blockquote>
    <p>Error at Command Line:10 Column:12 Error report: SQL Error: ORA-00998:
    must name this expression with a column alias
    00998. 00000 -  "must name this expression with a column alias"</p>
  </blockquote>
  
  <p>This doesn't work, however I previously tried this:</p>
  
  <pre><code>CREATE VIEW SOME_VIEW AS 
  (
    SELECT * FROM tbl_albums
  );
  </code></pre>
  
  <p>And this worked fine, want to ask, what is wrong with first query.</p>