MariusVolkhart / MariusVolkhart/squiggle-sql

Support for column aliases

Open
#15 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

auto-migrated Priority-Medium Type-Defect
Dominant language
Java
Stars
0
Forks
0
PR merge metrics
No merged PRs in 30d

Description

```
Currently we can't create select's with column aliases, like in

SELECT
p1.name as son,
p2.name as dad
FROM
PEOPLE p1,
PEOPLE p2
WHERE
p1.parentId = p2.id

Column aliases are useful when using the same table multiple times.

The attached file is a patch to SelectQuery for supporting Column aliases.

Actually, aliases are supported on all kind of Selectables, which will only
cause a problem when someone tries to alias the WildCardColumn. Empty aliases
will also create broken queries.

```

Original issue reported on code.google.com by `brunoabdon` on 6 Aug 2010 at 4:39

Attachments:
- [columnAliases.patch](https://storage.googleapis.com/google-code-attachments/squiggle-sql/issue-15/comment-0/columnAliases.patch)

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with SelectQuery and the attached columnAliases.patch to understand how selectable expressions are represented and rendered. Verify the reported PEOPLE self-join produces the requested aliases, and check the stated edge cases around WildCardColumn and empty aliases before considering the work complete.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
database
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.