1 Reply Latest reply on Mar 26, 2014 5:14 PM by thatJeffSmith-Oracle

    Autogenerated Group By Clause From Semantic Analysis Infotip Needs Refinement


      right now, when I use the info tip to autogenerate a group by clause on a query like this:



      SELECT col1, col2, (count distinct col3)

      FROM table1

      HAVING count(distinct col3) > 1;



      It generates the following sql:



      SELECT col1, col2, (count distinct col3)

      FROM table1 GROUP BY col1HAVING count(distinct col3) > 1;



      So it's stripping new newline before "HAVING" and thereby generating syntactically invalid sql since there is no space between col1 and HAVING. In general, I also think that it would be far preferable to have the GROUP BY clause always be inserted on its own line instead on the same line as the FROM clause.