ORDERBY case insensitive
See original GitHub issueIssue type:
[ ] question [ ] bug report [X] feature request [ ] documentation issue
Database system/driver:
[ ] cordova
[ ] mongodb
[ ] mssql
[ ] mysql
/ mariadb
[ ] oracle
[X] postgres
[ ] cockroachdb
[ ] sqlite
[ ] sqljs
[ ] react-native
[ ] expo
TypeORM version:
[X] latest
[ ] @next
[ ] 0.x.x
(or put your version here)
Steps to reproduce or a small repository showing the problem:
We currently can’t make a case insensitive orderBy (using orderBy of querybuilder)
Issue Analytics
- State:
- Created 4 years ago
- Comments:7
Top Results From Across the Web
How to use SQL Order By statement to sort results case ...
Yes, there's no way to change the behavior of ORDER BY to be case-insensitive. – Chad Birch. Mar 9, 2010 at 23:37. 2....
Read more >Case Insensitive ORDER BY clause using COLLATE
Case -sensitive sorting is guaranteed order between cases of the same letter: (a,a,A,A,b), case-insensitive sorting is not: (a,A,a,A,b), (A,a,a,A,b), etc, or ...
Read more >How to use SQL Order By statement to sort results ... - Intellipaat
I have an SQLite database that I am trying to sort by Alphabetical order. The problem is, SQLite ... know about? SELECT *...
Read more >Case-sensitivity quirks with Velocity sorts - Marketing Nation
By “alphabetically,” those folks mean case-insensitive sort order, where uppercase/lowercase pairs (in the local language) are treated as ...
Read more >Case-insensitive using 'ORDER BY' - SQLite Forum
I'm confused a bit by the ORDER BY operator. I would like it to be case-insensitive. I already have enabled 'case_sensitive_like = 1'...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@Ginden I don’t know what I’ve changed but its working fine now (even without LOWER()) But it’s not working if I’m sorting using a field of a joined table
for
.orderBy('LOWER(information.streetAddress)')
(information is a OneToOne relation in user table)But the request is working If I printSql() and run it manually. Looks like it consider ‘LOWER(’ as part of the alias
I’ve found an alternative way to solve the issue with the thrown ‘alias was not found’ error. Just added a temporary field with an alias while building a query which helped me to make case insensitive sorting.
e.g. you wanna use :
.orderBy('LOWER(information.streetAddress)')
Change it to these expressions in your QB and it should work: