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

  • SEARCH
  • Home
  • 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 7918603
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T15:33:54+00:00 2026-06-03T15:33:54+00:00

I have a database which contains an Assignment table. The table looks like this:

  • 0

I have a database which contains an Assignment table. The table looks like this:

ID | CHARACTER_ASS | TYPE_ASS

Inside the character column letters and numbers are stored. Ie. ‘A’, ‘a’, “Aa”. “AA”, 1 etc…
Now when i execute the following query in my query console:

select * from assignment a where a.CHARACTER_ASS = 'A'

It will return the lowercase entry in my database and the uppercase entry as well. Now I’ve been looking for an answer to this question and someone told me that this might because I’m running on a Windows OS. I’ve looked this up and could only find that there could be a problem with naming table names with/without lowercase (?).

One of the other problems is that I’m using spring data. In spring data I don’t have direct control of the query so I’m wondering if there is a specific fix for spring data.

I’d like to hear your answers regarding this issue 🙂

Thanks in advance

EDIT

My SHOW CREATE TABLE assignment:

CREATE TABLE `assignment` (
  `ID` int(11) NOT NULL AUTO_INCREMENT,
  `CHARACTER_ASS` varchar(45) NOT NULL,
  `TYPE_ASS` int(11) NOT NULL,
  PRIMARY KEY (`ID`)
) ENGINE=InnoDB AUTO_INCREMENT=17 DEFAULT CHARSET=utf8

EDIT2

I changed my Assignment table Collation to: latin1_general_cs and I tried querying manually in the MySql query editor, but I still get A and a back as result.
Then i tried to adjust the collation of the table to the same value as I did with the table.
Am i doing something wrong or should the adjustment work?

EDIT3

Ok I just fixxed it. Instead of using the latin1_general_cs I used utf8_bin. Seems that utf8 doesn’t have a Case Sensitive Collation 🙂 Thank you JB Nizet for pointing me in the right direction!

  • 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-06-03T15:33:56+00:00Added an answer on June 3, 2026 at 3:33 pm

    Specify a case-sensitive collation when you create the table:

    CREATE TABLE assignment (
        ID int(11) NOT NULL AUTO_INCREMENT,
        CHARACTER_ASS varchar(45) NOT NULL,
        TYPE_ASS int(11) NOT NULL,
        PRIMARY KEY (ID)
    ) ENGINE=InnoDB AUTO_INCREMENT=17 DEFAULT CHARSET=utf8, COLLATE=latin1_general_cs
    

    Note that the default collation can also be set globally, at the database level: http://dev.mysql.com/doc/refman/5.0/en/charset-database.html

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

we have a table in an Oracle Database which contains a column with the
I have a database column which contains varchar data type. I would like to
I have a database table which contains an ID column and a Name column.
I have one database table which contains 8 columns. One of the columns is
I have a database table which is full-text indexed and i use the CONTAINS-function
I have a table Person which contains 2 fields.In my another database i have
I have a MySQL database which contains a table of users. The primary key
I'm not sure how to do this... I have a database which contains a
I have a database table which contains an unsigned integer field to store the
i have a database table which contains some fields. one of the field's value

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.