Skip to content

net.sf.jsqlparser.JSQLParserException: Encountered unexpected token: "desc" "DESC" #1169

Closed

Description

@zhaochengbei

Describe the bug
parser error.

To Reproduce
Steps to reproduce the behavior:

  1. Example SQL : select a from b group by c desc;
  2. Parsing this SQL using JSqlParser with this statements
  3. Exception : JSQLParserException

Expected behavior
parser success.

System

  • mysql 5.7
  • Java 1.8
  • JSqlParser 4.0

Activity

  1. wumpz commented on Apr 28, 2021

    @wumpz
    Member

    I have never seen such a construct. Is group by c desc a shortcut for group by c order by c desc?

  2. zhaochengbei commented on Apr 29, 2021

    @zhaochengbei
    Author

    This is an old way of writing. This SQL can be run on MySQL.

  3. added a commit that references this issue on Sep 11, 2026
    7cc8638
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions