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

A column has been specified more than once in the order by list. Columns in the order by list must be unique. #111

Open
rebecajuliaa9 opened this issue Sep 23, 2024 Discussed in #110 · 0 comments

Comments

@rebecajuliaa9
Copy link

Discussed in #110

Originally posted by rebecajuliaa9 September 23, 2024
Here's the translation of the requested text into English:

The trait AuthenticationLoggable, in the authentications method, returns the user's login information, ordered by login_at. However, in the LogoutListener class, when fetching the most recent login log for the user, an additional ORDER BY clause is applied. Since the ordering is already defined in the trait, applying another ORDER BY results in an error due to the duplication of the clause.

This issue is specific to SQL Server, which requires that columns in the ORDER BY list be unique. When the same column is specified more than once, SQL Server throws the following error:
"A column has been specified more than once in the order by list. Columns in the order by list must be unique."

To resolve this, it’s important to ensure the ordering is applied only once—either in the trait or in the LogoutListener class—avoiding the duplication that leads to this error.

Trait AuthenticationLoggable
image

Listener Logout
image

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

No branches or pull requests

1 participant