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

Ambiguous Column Reference Id #990

Closed
zgunz42 opened this issue May 27, 2024 · 2 comments
Closed

Ambiguous Column Reference Id #990

zgunz42 opened this issue May 27, 2024 · 2 comments
Labels

Comments

@zgunz42
Copy link

zgunz42 commented May 27, 2024

func (r *EmailMessageRepository) GetByID(ctx context.Context, id int) (*model.EmailMessage, error) {
	message := new(model.EmailMessage)
	err := r.db.NewSelect().Model(message).Where("id = ?", id).Relation("Events").Relation("Account").Scan(ctx)
	return message, err
}

Error Msg

pgdriver.Error {m: map[uint8]string [83: "ERROR", 86: "ERROR", 67: "42702", 77: "column reference "id" is ambiguous", 80: "619", 70: "parse_relation.c", 76: "831", 82: "scanRTEForColumn", ]}

Copy link

This issue has been automatically marked as stale because it has not had activity in the last 30 days. If there is no update within the next 7 days, this issue will be closed.

@github-actions github-actions bot added the stale label Nov 18, 2024
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Nov 25, 2024
@khanakia
Copy link

@zgunz42 how did you solve the issue ?

I could solve it using prefix the table name in where like this email_messages.id = 11

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

2 participants