-2
我想創建一個臨時表。WITH子句 - 臨時表創建
select * from TFW_ARCHIVETRANSACTION
where TYPE = 'openAccountTransferLifeCycle' and STATUS = 5 and
to_char(substr(
TRANSACTIONDATA,
instr(TRANSACTIONDATA,'<ns:CredentialFunction>') + length('<ns:CredentialFunction>'),
instr(substr(
TRANSACTIONDATA,
instr(TRANSACTIONDATA,'<ns:CredentialFunction>') + length('<ns:CredentialFunction>')
), '</ns:CredentialFunction>') - 1
)) = 'OpenCurrentAccount';
我想這樣的:
with openAccountTransferLifeCycle_c AS (
select * from TFW_ARCHIVETRANSACTION
where TYPE = 'openAccountTransferLifeCycle'and STATUS = 5 and
to_char(substr(
TRANSACTIONDATA,
instr(TRANSACTIONDATA,'<ns:CredentialFunction>') + length('<ns:CredentialFunction>'),
instr(substr(
TRANSACTIONDATA,
instr(TRANSACTIONDATA,'<ns:CredentialFunction>') + length('<ns:CredentialFunction>')
), '</ns:CredentialFunction>') - 1
)) = 'OpenCurrentAccount'
);
,但它無法正常工作。
哪裏出錯?
請使用更好的標籤爲您的問題。你根本不應該使用[tag:table]標籤(它在描述中是這樣說的),[tag:temporary]也不代表任何意思。如果你的問題是關於MySQL或類似的話,請使用[tag:mysql]之類的東西;否則我們不知道你在說什麼。 – deceze
請同時說明你正在努力達到的目標。第二個片段是否應該創建一個臨時表?什麼告訴你它是「不工作」?你有任何一種錯誤輸出?你期望結果是什麼樣的?它看起來像什麼? – Julian