ORDER BY alias does not work with RETURN AS alias
- Dominant language
- C
- Stars
- 4.8k
- Forks
- 523
- Avg merge
- 1d 2h
- Merged PRs (30d)
- 9
Description
**Describe the bug**
ORDER BY alias does not work with RETURN AS alias
**How are you accessing AGE (Command line, driver, etc.)?**
- Command Line
**What data setup do we need to do?**
```pgsql
SELECT * FROM cypher('graph', $$
CREATE (:opt_match_v {name: 'someone'})-[:opt_match_e]->(:opt_match_v {name: 'somebody'}),
(:opt_match_v {name: 'anybody'})-[:opt_match_e]->(:opt_match_v {name: 'nobody'})
$$) AS (u agtype);
```
**What is the command that caused the error?**
```pgsql
SELECT * FROM cypher('graph', $$
MATCH p=(n)-[]->(m)
RETURN n.name as u
ORDER BY u
$$) AS (u agtype);
```
```
ERROR: could not find rte for u
LINE 2: MATCH p=(n)-[]->(m) RETURN n.name as u ORDER BY u
^
```
**Expected behavior**
Expected order by to work
**Environment (please complete the following information):**
- latest
Contributor guide
Assessment
This issue has not been assessed yet.