GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Support UNION clause · Issue #2 · JavaScriptor/js-sql-parser

Support UNION clause #2

New issue
Copy link
New issue
Copy link
Closed
Closed
Support UNION clause#2
Copy link
Labels
enhancement

Description

@albin3
albin3
opened on Oct 9, 2017
Issue body actions

https://dev.mysql.com/doc/refman/8.0/en/union.html

Activity

  1. albin3
    added
    enhancement
    on Oct 9, 2017
  2. shtse8 commented on Nov 20, 2017

    @shtse8
    shtse8
    on Nov 20, 2017
    More actions

    Can it support dash quote? like

    SELECT `attribute` FROM `table`
  3. albin3 commented on Nov 23, 2017

    @albin3
    albin3
    on Nov 23, 2017
    MemberAuthor
    More actions

    @shtse8 supported at [email protected]

    Reacted by Kyle Tse
  4. morenoh149 commented on Nov 24, 2017

    @morenoh149
    morenoh149
    on Nov 24, 2017
    More actions

    which commit added this functionality? 6d526bd ?

  5. albin3 commented on Nov 26, 2017

    @albin3
    albin3
    on Nov 26, 2017
    MemberAuthor
    More actions

    @morenoh149 UNION feature not supported yet.

  6. yuemingl commented on Jul 8, 2019

    @yuemingl
    yuemingl
    on Jul 8, 2019
    More actions

    Any update for union? I think it is important for data set generation from mixed sources in some applications.

  7. yuemingl commented on Jul 8, 2019

    @yuemingl
    yuemingl
    on Jul 8, 2019
    More actions

    This is a working change:
    sqlParser.jison
    UNION return 'UNION'
    selectClause
    : SELECT
    distinctOpt
    highPriorityOpt
    maxStateMentTimeOpt
    straightJoinOpt
    sqlSmallResultOpt
    sqlBigResultOpt
    sqlBufferResultOpt
    sqlCacheOpt
    sqlCalcFoundRowsOpt
    selectExprList
    selectDataSetOpt
    unionStatementsOpt
    {
    $$ = {
    type: 'Select',
    distinctOpt: $2,
    highPriorityOpt: $3,
    maxStateMentTimeOpt: $4,
    straightJoinOpt: $5,
    sqlSmallResultOpt: $6,
    sqlBigResultOpt: $7,
    sqlBufferResultOpt: $8,
    sqlCacheOpt: $9,
    sqlCalcFoundRowsOpt: $10,
    selectItems: $11,
    from: $12.from,
    partition: $12.partition,
    where: $12.where,
    groupBy: $12.groupBy,
    having: $12.having,
    orderBy: $12.orderBy,
    limit: $12.limit,
    procedure: $12.procedure,
    updateLockMode: $12.updateLockMode,
    union: $13
    }
    }
    ;
    unionStatementsOpt
    : unionStatementsOpt unionStatement { $$ = $2 }
    | { $$ = null }
    ;
    unionStatement
    : UNION selectClause { $$ = {select: $2} }
    ;

    main.test.js
    it ('test15', function () {
    testParser(SELECT * from A UNION SELECT * from B UNION SELECT * from C);
    });

    For the test above, the ast looks like:
    nodeType: "Main"
    value:
    -type: "Select"
    -union:
    --select:
    ---type: "Select"
    ---union:
    ----select:
    ----type: "Select"
    -----union: null

  8. albin3
    added a commit that references this issue on Jul 9, 2019

    feat: union grammar, to resolve grammar conflicts. #2

    4724fab
  9. albin3 commented on Jul 22, 2019

    @albin3
    albin3
    on Jul 22, 2019
    MemberAuthor
    More actions

    supported since [email protected]

  10. albin3
    closed this as completedon Jul 22, 2019
  11. albin3 commented on Jul 22, 2019

    @albin3
    albin3
    on Jul 22, 2019
    MemberAuthor
    More actions

    @morenoh149 @yuemingl Union feature has supported.

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

    enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402520 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.