Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in SQL by (20.3k points)

I have an SQLite database that I am trying to sort by Alphabetical order. The problem is, SQLite doesn't seem to consider A=a during sorting, thus I get results like this:

A B C T a b c g

I want to get:

A a b B C c g T

What special SQL thing needs to be done that I don't know about?

SELECT * FROM NOTES ORDER BY title

1 Answer

0 votes
by (40.7k points)

You can use ORDER BY TITLE COLLATE NOCASE.

Edit: To specify ASC or DESC, add this after NOCASE like this:

ORDER BY TITLE COLLATE NOCASE ASC

or

ORDER BY TITLE COLLATE NOCASE DESC

Related questions

0 votes
1 answer
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer
asked Jul 17, 2019 in SQL by Tech4ever (20.3k points)
Welcome to Intellipaat Community. Get your technical queries answered by top developers!

30.5k questions

32.5k answers

500 comments

108k users

Browse Categories

...