{
    "query": "select (SELECT name FROM mysql.help_category WHERE help_category_id = 1) as name,\ncase 1 when 1 then \"Some\" when 2 when \"Other\" end FROM a;",
    "lexer": {
        "@type": "PhpMyAdmin\\SqlParser\\Lexer",
        "str": "select (SELECT name FROM mysql.help_category WHERE help_category_id = 1) as name,\ncase 1 when 1 then \"Some\" when 2 when \"Other\" end FROM a;",
        "len": 139,
        "last": 139,
        "list": {
            "@type": "PhpMyAdmin\\SqlParser\\TokensList",
            "tokens": [
                {
                    "@type": "PhpMyAdmin\\SqlParser\\Token",
                    "token": "select",
                    "value": "SELECT",
                    "keyword": "SELECT",
                    "type": 1,
                    "flags": 3,
                    "position": 0
                },
                {
                    "@type": "PhpMyAdmin\\SqlParser\\Token",
                    "token": " ",
                    "value": " ",
                    "keyword": null,
                    "type": 3,
                    "flags": 0,
                    "position": 6
                },
                {
                    "@type": "PhpMyAdmin\\SqlParser\\Token",
                    "token": "(",
                    "value": "(",
                    "keyword": null,
                    "type": 2,
                    "flags": 16,
                    "position": 7
                },
                {
                    "@type": "PhpMyAdmin\\SqlParser\\Token",
                    "token": "SELECT",
                    "value": "SELECT",
                    "keyword": "SELECT",
                    "type": 1,
                    "flags": 3,
                    "position": 8
                },
                {
                    "@type": "PhpMyAdmin\\SqlParser\\Token",
                    "token": " ",
                    "value": " ",
                    "keyword": null,
                    "type": 3,
                    "flags": 0,
                    "position": 14
                },
                {
                    "@type": "PhpMyAdmin\\SqlParser\\Token",
                    "token": "name",
                    "value": "name",
                    "keyword": "NAME",
                    "type": 1,
                    "flags": 1,
                    "position": 15
                },
                {
                    "@type": "PhpMyAdmin\\SqlParser\\Token",
                    "token": " ",
                    "value": " ",
                    "keyword": null,
                    "type": 3,
                    "flags": 0,
                    "position": 19
                },
                {
                    "@type": "PhpMyAdmin\\SqlParser\\Token",
                    "token": "FROM",
                    "value": "FROM",
                    "keyword": "FROM",
                    "type": 1,
                    "flags": 3,
                    "position": 20
                },
                {
                    "@type": "PhpMyAdmin\\SqlParser\\Token",
                    "token": " ",
                    "value": " ",
                    "keyword": null,
                    "type": 3,
                    "flags": 0,
                    "position": 24
                },
                {
                    "@type": "PhpMyAdmin\\SqlParser\\Token",
                    "token": "mysql",
                    "value": "mysql",
                    "keyword": null,
                    "type": 0,
                    "flags": 0,
                    "position": 25
                },
                {
                    "@type": "PhpMyAdmin\\SqlParser\\Token",
                    "token": ".",
                    "value": ".",
                    "keyword": null,
                    "type": 2,
                    "flags": 16,
                    "position": 30
                },
                {
                    "@type": "PhpMyAdmin\\SqlParser\\Token",
                    "token": "help_category",
                    "value": "help_category",
                    "keyword": null,
                    "type": 0,
                    "flags": 0,
                    "position": 31
                },
                {
                    "@type": "PhpMyAdmin\\SqlParser\\Token",
                    "token": " ",
                    "value": " ",
                    "keyword": null,
                    "type": 3,
                    "flags": 0,
                    "position": 44
                },
                {
                    "@type": "PhpMyAdmin\\SqlParser\\Token",
                    "token": "WHERE",
                    "value": "WHERE",
                    "keyword": "WHERE",
                    "type": 1,
                    "flags": 3,
                    "position": 45
                },
                {
                    "@type": "PhpMyAdmin\\SqlParser\\Token",
                    "token": " ",
                    "value": " ",
                    "keyword": null,
                    "type": 3,
                    "flags": 0,
                    "position": 50
                },
                {
                    "@type": "PhpMyAdmin\\SqlParser\\Token",
                    "token": "help_category_id",
                    "value": "help_category_id",
                    "keyword": null,
                    "type": 0,
                    "flags": 0,
                    "position": 51
                },
                {
                    "@type": "PhpMyAdmin\\SqlParser\\Token",
                    "token": " ",
                    "value": " ",
                    "keyword": null,
                    "type": 3,
                    "flags": 0,
                    "position": 67
                },
                {
                    "@type": "PhpMyAdmin\\SqlParser\\Token",
                    "token": "=",
                    "value": "=",
                    "keyword": null,
                    "type": 2,
                    "flags": 2,
                    "position": 68
                },
                {
                    "@type": "PhpMyAdmin\\SqlParser\\Token",
                    "token": " ",
                    "value": " ",
                    "keyword": null,
                    "type": 3,
                    "flags": 0,
                    "position": 69
                },
                {
                    "@type": "PhpMyAdmin\\SqlParser\\Token",
                    "token": "1",
                    "value": 1,
                    "keyword": null,
                    "type": 6,
                    "flags": 0,
                    "position": 70
                },
                {
                    "@type": "PhpMyAdmin\\SqlParser\\Token",
                    "token": ")",
                    "value": ")",
                    "keyword": null,
                    "type": 2,
                    "flags": 16,
                    "position": 71
                },
                {
                    "@type": "PhpMyAdmin\\SqlParser\\Token",
                    "token": " ",
                    "value": " ",
                    "keyword": null,
                    "type": 3,
                    "flags": 0,
                    "position": 72
                },
                {
                    "@type": "PhpMyAdmin\\SqlParser\\Token",
                    "token": "as",
                    "value": "AS",
                    "keyword": "AS",
                    "type": 1,
                    "flags": 3,
                    "position": 73
                },
                {
                    "@type": "PhpMyAdmin\\SqlParser\\Token",
                    "token": " ",
                    "value": " ",
                    "keyword": null,
                    "type": 3,
                    "flags": 0,
                    "position": 75
                },
                {
                    "@type": "PhpMyAdmin\\SqlParser\\Token",
                    "token": "name",
                    "value": "name",
                    "keyword": "NAME",
                    "type": 1,
                    "flags": 1,
                    "position": 76
                },
                {
                    "@type": "PhpMyAdmin\\SqlParser\\Token",
                    "token": ",",
                    "value": ",",
                    "keyword": null,
                    "type": 2,
                    "flags": 16,
                    "position": 80
                },
                {
                    "@type": "PhpMyAdmin\\SqlParser\\Token",
                    "token": "\n",
                    "value": " ",
                    "keyword": null,
                    "type": 3,
                    "flags": 0,
                    "position": 81
                },
                {
                    "@type": "PhpMyAdmin\\SqlParser\\Token",
                    "token": "case",
                    "value": "CASE",
                    "keyword": "CASE",
                    "type": 1,
                    "flags": 3,
                    "position": 82
                },
                {
                    "@type": "PhpMyAdmin\\SqlParser\\Token",
                    "token": " ",
                    "value": " ",
                    "keyword": null,
                    "type": 3,
                    "flags": 0,
                    "position": 86
                },
                {
                    "@type": "PhpMyAdmin\\SqlParser\\Token",
                    "token": "1",
                    "value": 1,
                    "keyword": null,
                    "type": 6,
                    "flags": 0,
                    "position": 87
                },
                {
                    "@type": "PhpMyAdmin\\SqlParser\\Token",
                    "token": " ",
                    "value": " ",
                    "keyword": null,
                    "type": 3,
                    "flags": 0,
                    "position": 88
                },
                {
                    "@type": "PhpMyAdmin\\SqlParser\\Token",
                    "token": "when",
                    "value": "WHEN",
                    "keyword": "WHEN",
                    "type": 1,
                    "flags": 3,
                    "position": 89
                },
                {
                    "@type": "PhpMyAdmin\\SqlParser\\Token",
                    "token": " ",
                    "value": " ",
                    "keyword": null,
                    "type": 3,
                    "flags": 0,
                    "position": 93
                },
                {
                    "@type": "PhpMyAdmin\\SqlParser\\Token",
                    "token": "1",
                    "value": 1,
                    "keyword": null,
                    "type": 6,
                    "flags": 0,
                    "position": 94
                },
                {
                    "@type": "PhpMyAdmin\\SqlParser\\Token",
                    "token": " ",
                    "value": " ",
                    "keyword": null,
                    "type": 3,
                    "flags": 0,
                    "position": 95
                },
                {
                    "@type": "PhpMyAdmin\\SqlParser\\Token",
                    "token": "then",
                    "value": "THEN",
                    "keyword": "THEN",
                    "type": 1,
                    "flags": 3,
                    "position": 96
                },
                {
                    "@type": "PhpMyAdmin\\SqlParser\\Token",
                    "token": " ",
                    "value": " ",
                    "keyword": null,
                    "type": 3,
                    "flags": 0,
                    "position": 100
                },
                {
                    "@type": "PhpMyAdmin\\SqlParser\\Token",
                    "token": "\"Some\"",
                    "value": "Some",
                    "keyword": null,
                    "type": 7,
                    "flags": 2,
                    "position": 101
                },
                {
                    "@type": "PhpMyAdmin\\SqlParser\\Token",
                    "token": " ",
                    "value": " ",
                    "keyword": null,
                    "type": 3,
                    "flags": 0,
                    "position": 107
                },
                {
                    "@type": "PhpMyAdmin\\SqlParser\\Token",
                    "token": "when",
                    "value": "WHEN",
                    "keyword": "WHEN",
                    "type": 1,
                    "flags": 3,
                    "position": 108
                },
                {
                    "@type": "PhpMyAdmin\\SqlParser\\Token",
                    "token": " ",
                    "value": " ",
                    "keyword": null,
                    "type": 3,
                    "flags": 0,
                    "position": 112
                },
                {
                    "@type": "PhpMyAdmin\\SqlParser\\Token",
                    "token": "2",
                    "value": 2,
                    "keyword": null,
                    "type": 6,
                    "flags": 0,
                    "position": 113
                },
                {
                    "@type": "PhpMyAdmin\\SqlParser\\Token",
                    "token": " ",
                    "value": " ",
                    "keyword": null,
                    "type": 3,
                    "flags": 0,
                    "position": 114
                },
                {
                    "@type": "PhpMyAdmin\\SqlParser\\Token",
                    "token": "when",
                    "value": "WHEN",
                    "keyword": "WHEN",
                    "type": 1,
                    "flags": 3,
                    "position": 115
                },
                {
                    "@type": "PhpMyAdmin\\SqlParser\\Token",
                    "token": " ",
                    "value": " ",
                    "keyword": null,
                    "type": 3,
                    "flags": 0,
                    "position": 119
                },
                {
                    "@type": "PhpMyAdmin\\SqlParser\\Token",
                    "token": "\"Other\"",
                    "value": "Other",
                    "keyword": null,
                    "type": 7,
                    "flags": 2,
                    "position": 120
                },
                {
                    "@type": "PhpMyAdmin\\SqlParser\\Token",
                    "token": " ",
                    "value": " ",
                    "keyword": null,
                    "type": 3,
                    "flags": 0,
                    "position": 127
                },
                {
                    "@type": "PhpMyAdmin\\SqlParser\\Token",
                    "token": "end",
                    "value": "end",
                    "keyword": "END",
                    "type": 1,
                    "flags": 1,
                    "position": 128
                },
                {
                    "@type": "PhpMyAdmin\\SqlParser\\Token",
                    "token": " ",
                    "value": " ",
                    "keyword": null,
                    "type": 3,
                    "flags": 0,
                    "position": 131
                },
                {
                    "@type": "PhpMyAdmin\\SqlParser\\Token",
                    "token": "FROM",
                    "value": "FROM",
                    "keyword": "FROM",
                    "type": 1,
                    "flags": 3,
                    "position": 132
                },
                {
                    "@type": "PhpMyAdmin\\SqlParser\\Token",
                    "token": " ",
                    "value": " ",
                    "keyword": null,
                    "type": 3,
                    "flags": 0,
                    "position": 136
                },
                {
                    "@type": "PhpMyAdmin\\SqlParser\\Token",
                    "token": "a",
                    "value": "a",
                    "keyword": null,
                    "type": 0,
                    "flags": 0,
                    "position": 137
                },
                {
                    "@type": "PhpMyAdmin\\SqlParser\\Token",
                    "token": ";",
                    "value": ";",
                    "keyword": null,
                    "type": 9,
                    "flags": 0,
                    "position": 138
                },
                {
                    "@type": "PhpMyAdmin\\SqlParser\\Token",
                    "token": null,
                    "value": null,
                    "keyword": null,
                    "type": 9,
                    "flags": 0,
                    "position": null
                }
            ],
            "count": 54,
            "idx": 54
        },
        "delimiter": ";",
        "delimiterLen": 1,
        "strict": false,
        "errors": []
    },
    "parser": {
        "@type": "PhpMyAdmin\\SqlParser\\Parser",
        "list": {
            "@type": "@1"
        },
        "statements": [
            {
                "@type": "PhpMyAdmin\\SqlParser\\Statements\\SelectStatement",
                "expr": [
                    {
                        "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression",
                        "database": null,
                        "table": null,
                        "column": null,
                        "expr": "(SELECT name FROM mysql.help_category WHERE help_category_id = 1)",
                        "alias": "name",
                        "function": null,
                        "subquery": "SELECT"
                    },
                    {
                        "@type": "PhpMyAdmin\\SqlParser\\Components\\CaseExpression",
                        "value": {
                            "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression",
                            "database": null,
                            "table": null,
                            "column": null,
                            "expr": "1",
                            "alias": null,
                            "function": null,
                            "subquery": null
                        },
                        "conditions": [],
                        "results": [
                            {
                                "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression",
                                "database": null,
                                "table": null,
                                "column": "Some",
                                "expr": "\"Some\"",
                                "alias": null,
                                "function": null,
                                "subquery": null
                            }
                        ],
                        "compare_values": [
                            {
                                "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression",
                                "database": null,
                                "table": null,
                                "column": null,
                                "expr": "1",
                                "alias": null,
                                "function": null,
                                "subquery": null
                            },
                            {
                                "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression",
                                "database": null,
                                "table": null,
                                "column": null,
                                "expr": "2",
                                "alias": null,
                                "function": null,
                                "subquery": null
                            }
                        ],
                        "else_result": null,
                        "alias": null,
                        "expr": ""
                    }
                ],
                "from": [
                    {
                        "@type": "PhpMyAdmin\\SqlParser\\Components\\Expression",
                        "database": null,
                        "table": "a",
                        "column": null,
                        "expr": "a",
                        "alias": null,
                        "function": null,
                        "subquery": null
                    }
                ],
                "index_hints": null,
                "partition": null,
                "where": null,
                "group": null,
                "group_options": null,
                "having": null,
                "order": null,
                "limit": null,
                "procedure": null,
                "into": null,
                "join": null,
                "union": [],
                "end_options": null,
                "options": {
                    "@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray",
                    "options": []
                },
                "first": 0,
                "last": 51
            }
        ],
        "brackets": 0,
        "strict": false,
        "errors": []
    },
    "errors": {
        "lexer": [],
        "parser": [
            [
                "Unexpected keyword.",
                {
                    "@type": "@45"
                },
                0
            ],
            [
                "Unexpected end of CASE expression",
                {
                    "@type": "@44"
                },
                0
            ],
            [
                "Unrecognized keyword.",
                {
                    "@type": "@45"
                },
                0
            ],
            [
                "Unexpected token.",
                {
                    "@type": "@47"
                },
                0
            ],
            [
                "Unrecognized keyword.",
                {
                    "@type": "@49"
                },
                0
            ]
        ]
    }
}