^ 1在SQL调用中意味着什么?

Kav*_*ani 3 java sql t-sql

SELECT LOWER(pla_lan_code) as locale,
    pla_auto_translate_opt_out_flag^1 as autoTranslationEnabled,
    pte_manual_edit_flag^1 as autoTranslated,
    ftr_created_date as queuedDate,
    ftr_translation_date as translationDate,
    ftr_engine as translationEngine,
    ftr_id as translationId,
    pla_auto_translate_opt_out_flag as translationOptOut

SELECT * FROM property_languages (nolock)
    LEFT OUTER JOIN properties_text_live (nolock)
Run Code Online (Sandbox Code Playgroud)

此查询嵌入在Java代码中.我试图将其转换为存储过程.我想知道^ 1在SQL中等同于什么.

Nat*_*hes 5

这不是标准的SQL.在Transact-SQL(在MS SQL Server和Sybase中使用)^是按位异或运算符.

1 ^ 1为0,0 ^ 1为1.

如果原始int将0存储为false而1存储为true,则XORing为1会反转原始标志的意义.

猜测pla_auto_translate_opt_out_flag是一个int,其中1表示选择输出,0表示启用自动转换,使用运算符返回1表示启用,0表示选择退出.