Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 230517
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T19:51:21+00:00 2026-05-11T19:51:21+00:00

I want to select records from sqlite3 database by string matching. But if I

  • 0

I want to select records from sqlite3 database by string matching. But if I use ‘=’ in the where clause, I found that sqlite3 is case sensitive. Can anyone tell me how to use string comparing case-insensitive?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-11T19:51:21+00:00Added an answer on May 11, 2026 at 7:51 pm

    You can use COLLATE NOCASE in your SELECT query:

    SELECT * FROM ... WHERE name = 'someone' COLLATE NOCASE
    

    Additionaly, in SQLite, you can indicate that a column should be case insensitive when you create the table by specifying collate nocase in the column definition (the other options are binary (the default) and rtrim; see here). You can specify collate nocase when you create an index as well. For example:

    create table Test
    (
      Text_Value  text collate nocase
    );
    
    insert into Test values ('A');
    insert into Test values ('b');
    insert into Test values ('C');
    
    create index Test_Text_Value_Index
      on Test (Text_Value collate nocase);
    

    Expressions involving Test.Text_Value should now be case insensitive. For example:

    sqlite> select Text_Value from Test where Text_Value = 'B';
    Text_Value      
    ----------------
    b               
    
    sqlite> select Text_Value from Test order by Text_Value;
    Text_Value      
    ----------------
    A               
    b               
    C    
    
    sqlite> select Text_Value from Test order by Text_Value desc;
    Text_Value      
    ----------------
    C               
    b               
    A               
    

    The optimiser can also potentially make use of the index for case-insensitive searching and matching on the column. You can check this using the explain SQL command, e.g.:

    sqlite> explain select Text_Value from Test where Text_Value = 'b';
    addr              opcode          p1          p2          p3                               
    ----------------  --------------  ----------  ----------  ---------------------------------
    0                 Goto            0           16                                           
    1                 Integer         0           0                                            
    2                 OpenRead        1           3           keyinfo(1,NOCASE)                
    3                 SetNumColumns   1           2                                            
    4                 String8         0           0           b                                
    5                 IsNull          -1          14                                           
    6                 MakeRecord      1           0           a                                
    7                 MemStore        0           0                                            
    8                 MoveGe          1           14                                           
    9                 MemLoad         0           0                                            
    10                IdxGE           1           14          +                                
    11                Column          1           0                                            
    12                Callback        1           0                                            
    13                Next            1           9                                            
    14                Close           1           0                                            
    15                Halt            0           0                                            
    16                Transaction     0           0                                            
    17                VerifyCookie    0           4                                            
    18                Goto            0           1                                            
    19                Noop            0           0                                            
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 105k
  • Answers 105k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer You don't need to delete the entire registry key. Deleting… May 11, 2026 at 8:48 pm
  • Editorial Team
    Editorial Team added an answer on /Applications/Eclipse/Eclipse.app right click and choose "Show Package Contents" open… May 11, 2026 at 8:48 pm
  • Editorial Team
    Editorial Team added an answer The reason it uses license files is to make it… May 11, 2026 at 8:48 pm

Related Questions

I've been using SQL for years now but rarely anything more that simple inserts
SELECT item_name from items WHERE item_id = $var; I tried: $var = 001 ||
I want to select records that are 1 month old or newer. The query
I want to show a random record from the database. I would like to
I need to copy some records from our SQLServer 2005 test server to our

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.