2013-10-21 97 views
3
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) 

此查詢嵌入在Java代碼中。我試圖將其轉換爲存儲過程。我想知道在SQL中^ 1等於什麼。^1在SQL調用中意味着什麼?

+10

您正在使用哪種數據庫引擎? –

+0

儘管您沒有告訴我們您正在使用哪個DBMS,但我幾乎100%確定這是在您的DBMS手冊中記錄的。尋找一個稱爲「操作員」或「功能」或類似的章節 –

回答

5

這不是標準的SQL。在Transact-SQL中(用於MS SQL Server和Sybase)^bitwise exclusive-OR operator

1^1爲0,0^1是1。

如果原始INT存儲0代表假,1代表真,異或由1將扭轉原標誌的意義。

猜測pla_auto_translate_opt_out_flag是一個int,其中1表示退出,0表示啓用自動轉換,使用操作符返回1表示啓用,0表示退出。