Oracle
 sql >> Datenbank >  >> RDS >> Oracle

Strings vergleichen ohne Akzente in SQL (ORACLE)

Oracle-Setup :

CREATE TABLE TABLE_NAME ( value ) AS
SELECT 'pepé' FROM DUAL;

-- Not necessary to create an index but it can speed things up.
CREATE INDEX value_without_accent_idx
  ON TABLE_NAME ( CONVERT( value, 'US7ASCII' ) );

Abfrage :

SELECT *
FROM   table_name
WHERE  CONVERT( value, 'US7ASCII' ) = 'pepe';

Ausgabe :

VALUE
-----
pepé