0

Hi friends,

I think the MySql is not case sensitive for selecting values. for example I am having a table called dept,

Id | Depart

1 | BTECH
11 | it
12 | ibt
2 | BE
21 | cse
22 | ece

Now i want to select the capital dept values from dept, but not using the id. how can i achieve it. I tried the following as query ..
select upper(depart) from dept;
but its just converting all values of dept table to capital. that is
it shows as follows
BTECH
IT
IBT
BE
CSE
ECE.
So how can i filter the lower case values to just display the upper case values to look like the following result

Depart

BTECH
BE

please help me if u know the solution.

3
Contributors
4
Replies
6
Views
9 Years
Discussion Span
Last Post by kutta_vin
0

try this

CONCAT( UPPER( SUBSTRING( colname, 1, 1 ) ) , LOWER( SUBSTRING( colname, 2 ) ) )
0

try this

CONCAT( UPPER( SUBSTRING( colname, 1, 1 ) ) , LOWER( SUBSTRING( colname, 2 ) ) )

Hello R0bb0b,

Your query doesn't works for me.

0

This will also work select * from table1 where (depart COLLATE latin1_bin )=Upper(depart)

Hello varmadba,

Thanks for giving your query, its works for me.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.