我需要将 SQL 转换为 transbase,因为当我在 Transbase 中使用以下脚本时,我得到了一个非常丑陋的错误。
我的脚本:
SELECT STR_ID, TEX_TEXT AS STR_DES_TEXT, IF( EXISTS( SELECT * FROM tof_SEARCH_TREE AS SEARCH_TREE2
WHERE SEARCH_TREE2.STR_ID_PARENT <> tof_SEARCH_TREE.STR_ID
), 1, 0) AS DESCENDANTS
FROM tof_SEARCH_TREE
INNER JOIN tof_DESIGNATIONS ON DES_ID = STR_DES_ID
INNER JOIN tof_DES_TEXTS ON TEX_ID = DES_TEX_ID
WHERE STR_ID_PARENT <> NULL AND DES_LNG_ID = 21 AND EXISTS (
SELECT * FROM tof_LINK_GA_STR
INNER JOIN tof_LINK_LA_TYP ON LAT_TYP_ID = 3822 AND LAT_GA_ID = LGS_GA_ID
INNER JOIN tof_LINK_ART ON LA_ID = LAT_LA_ID
WHERE LGS_STR_ID = STR_ID
);
我的错误是:
编译错误:')' 预期:在 >2<: FROM tof_SEARCH_TREE AS SEARCH_TREE2