0

I have a SQL Server bit of code like this:

SELECT    [something]
FROM      [Table1] 
          JOIN [Table2] 
               ON [Table1].Field = [Table2].Field COLLATE Latin1_General_CI_AS

How can I rewrite this to work in Oracle?

I've consulted a few places like here, but I'm a little confused about how to translate a wildcard search into a join query.

Community
  • 1
  • 1
Andrew Martin
  • 5,619
  • 10
  • 54
  • 92
  • You don't need the `collate` in Oracle (but you *do* need to remove those dreaded square brackets) –  Feb 17 '15 at 14:31
  • Ha. I don't know why, but I included them in the question as I thought it might look neater. I would never code with them. So basically, that part is redundant in this join is what you're saying? – Andrew Martin Feb 17 '15 at 14:32
  • `COLLATE` in SQL Server is used to override the column collation where appropriate -- for example, if `[Table1].Field` is using a case-sensitive collation and you want the comparison to be case-insensitive, you'd need a `COLLATE` override. Ditto if you are dealing with a migrated table using an old collation from previous versions. Obviously, if your database is well-designed, this is fairly rare. I have no idea what Oracle does regarding collations (an earlier version of this comment foolishly linked to the MySQL docs, which is of course "also Oracle" now.) – Jeroen Mostert Feb 17 '15 at 15:02

0 Answers0