Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
fix error in same name column reference "id" is ambiguous #3727
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
base: main
Are you sure you want to change the base?
Uh oh!
There was an error while loading. Please reload this page.
fix error in same name column reference "id" is ambiguous #3727
Changes from all commits
88b10e2File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
example: CREATE TABLE IF NOT EXISTS `app` ( `id` INT NOT NULL AUTO_INCREMENT, `parent_app_id` INT NOT NULL DEFAULT 0 COMMENT '合并父应用id', PRIMARY KEY (`id`) USING BTREE ) AUTO_INCREMENT = 105 COMMENT = 'API所属的应用信息'; CREATE TABLE IF NOT EXISTS `user_account` ( `id` BIGINT NOT NULL AUTO_INCREMENT COMMENT '主键id', `name` VARCHAR(255) COMMENT '账号名称', PRIMARY KEY (`id`) USING BTREE ) AUTO_INCREMENT = 1 COMMENT='账号表,存储账号的基本信息和安全评分'; -- name: GetUserAccountAllChildIDs :exec WITH app_user_account_id AS ( SELECT tua.id, tua.name, CAST(IFNULL(tb.id, ta.id) AS SIGNED) AS parent_app_id FROM user_account AS tua LEFT JOIN app AS ta ON ta.id = tua.app_id LEFT JOIN app as tb ON ta.parent_app_id = tb.id WHERE tua.masked_sign = 1 AND tua.deleted_sign = 1 AND ta.masked_sign = 1 AND ta.deleted_sign = 1 ) SELECT a.name FROM app_user_account_id AS a LEFT JOIN app_user_account_id AS b ON b.id IN (sqlc.slice('account_id_set')) AND a.name = b.name AND a.parent_app_id = b.parent_app_id;Uh oh!
There was an error while loading. Please reload this page.
There are no files selected for viewing
Uh oh!
There was an error while loading. Please reload this page.