Unsupported Screen Size: The viewport size is too small for the theme to render properly.

Small Sql Formatter Issues

forums forums SQLyog SQLyog: Bugs / Feature Requests Small Sql Formatter Issues

  • This topic is empty.
Viewing 2 reply threads
  • Author
    Posts
    • #11537
      vygi
      Member

      1:

      SQL formater does not work on some queries when values are being calculated using several SQL functions and assigned (with AS) to some alias/name, eg. “SELECT … SUM(…)/COUNT(…) AS …”

      Example:

      Code:
      SELECT SUM(LENGTH(User))/COUNT(*) AS AverageNameLength FROM mysql.user;

      the formatter works, though, when the formula is in brackets:

      Code:
      SELECT (SUM(LENGTH(User))/COUNT(*)) AS AverageNameLength FROM mysql.user;

      2 (related):

      SQL formater works “strangely” when same queries without “AS”.

      Example:

      Code:
      SELECT COUNT(*), SUM(LENGTH(User))/COUNT(*) FROM mysql.user;

      this will be converted to:

      Code:
      SELECT
      COUNT(*),
      SUM(LENGTH(User)) /COUNT(*)
      FROM mysql.user;

      (note spaces before “/COUNT(*)”)

    • #29139
      peterlaursen
      Participant

      Any idea if it is a problem with the COUNT() aggregate function only (and not constants for instance)? Anyway we will check this!

    • #29140
      navyashree.r
      Member

      Hi,

      Issue confirmed.

      We have added in our tracker,

      http://code.google.com/p/sqlyog/issues/detail?id=979

      Thanks for reporting.

      Regards,

      Navya

Viewing 2 reply threads
  • You must be logged in to reply to this topic.