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

Sorting does not occur for field names in Latin or in quotation marks! #2039

Open
StarfairStudio opened this issue Jan 21, 2025 · 3 comments

Comments

@StarfairStudio
Copy link

StarfairStudio commented Jan 21, 2025

When creating a SQL query to Excel tables, if the column names are not in Latin, then you cannot sort using 'order by' if the column name is used without quotes (a syntax error occurs):
let sql="select recordset * from xlsx('c:\\MyTable.xlsx') order by Поле";//syntax error

In the case of using quotes, this function simply does not work, since it is not the contents of the field that are compared, but its name, and they are always equal to each other for the compared rows when sorting inside AlaSQL:
let sql="select recordset * from xlsx('c:\\MyTable.xlsx') order by 'Поле'";//Sorting does not occur!

@StarfairStudio
Copy link
Author

I think I found a solution. It works if you pack the name of the required columns in square brackets:
let sql="select recordset * from xlsx('c:\\MyTable.xlsx') order by [Поле]";//All ok!

@mathiasrw
Copy link
Member

I am very happy that you found this solution. However, ill keep it open to allow anyone to provide a fix.

@StarfairStudio
Copy link
Author

I agree! You have a great library, but sometimes you have needs like the one I described, and it would be great to be able to make queries without escaping the column names!

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

No branches or pull requests

2 participants