无法在SQL查询中使用collat​​e

时间:2015-04-08 19:52:38

标签: sql oracle

select hr_id from users where hr_id COLLATE SQL_Latin1_General_CP1_CS_AS='Rj001a'
                                    *
ERROR at line 1:
ORA-00920: invalid relational operator

1 个答案:

答案 0 :(得分:1)

您可以使用NLSSORT来指定Oracle中的排序规则:

select hr_id 
from users 
where NLSSORT(hr_id, 'NLS_SORT = Latin_CI')  = NLSSORT('Rj001a', 'NLS_SORT = Latin_CI')