5

I have two tables City and CityCommunity in City table one column contain cityName like this

cityName = 'ABC'

And in CityCommunity table we have same column cityName but value of this columnName is something like this

 cityName = 'abc' 

Will it effect in query when we will run a Join query. In my case when I am joining these two table in the above case when both cityName same but only difference is case sensitive will it effect query to run

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
subodh joshi
  • 365
  • 3
  • 10
  • 5
    It depends upon the COLLATION - See [Collation and Unicode Support](http://msdn.microsoft.com/en-us/library/ms143503(v=sql.105).aspx) (the default collation is usually "CI" for Case Insensitive.) – user2864740 Jan 14 '14 at 06:41
  • Can say yes and can say No.. it depends. If your DB collation is CS(Case Sensitive) then yes it is if its CI (Case Insensitive) then not.. Generally for UserId nd Password like sensitive information we g for CS. –  Jan 14 '14 at 06:44
  • 1
    Check this http://stackoverflow.com/questions/3969059/sql-case-sensitive-string-compare – Naveen Jan 14 '14 at 06:46

2 Answers2

5

By default it is not case sensitive. So it will treat 'ABC' and 'abc' as same. But to make it case sensitive you have to use COLLATE. You can find the detailed explanation with example HERE . This applys to join also.

Naveen
  • 1,496
  • 1
  • 15
  • 24
0

In Oracle Yes, the results are case sensitive so if you are looking for cityName = 'ABC' the results with cityName = 'abc' or cityName ='Abc' won't show!

You need to add UPPER so you can get all results

SELECT UPPER(cityName)
FROM City;

in this case, no matter what case are the results it will convert the whole column data to upper case