Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Need to be able to refer to a derived table's columns #52

Closed
jaypipes opened this issue Sep 17, 2017 · 0 comments
Closed

Need to be able to refer to a derived table's columns #52

jaypipes opened this issue Sep 17, 2017 · 0 comments
Assignees
Labels

Comments

@jaypipes
Copy link
Owner

When creating a derived table by, for example, creating a subselect and joining to it:

subq := sqlb.Select(colOrgId).As("o1")

In order to join the above subquery to another table, we need to do something like this:

joinCond := sqlb.Equal(colOrgId, subq.Column("id"))
q := sqlb.Select(orgs).Join(subq, joinCond)

The problem is that SelectQuery (which is returned from the SelectQuery.As() method) does not have a Column() method and therefore we have no way to refer to the subquery's projections (columns).

@jaypipes jaypipes added the bug label Sep 17, 2017
@jaypipes jaypipes self-assigned this Sep 17, 2017
jaypipes added a commit that referenced this issue Sep 17, 2017
Adds a SelectQuery.Column() method that allows projections of a derived
table to be referenced in an outer join or where condition.

Fixes Issue #52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant