本工具包支持接近sql风格的 if 语句, 实际对于 if 语句的支持如下:
if [not] exists (select code from xxx) [then (select 1)] [else (select 2)] [end if]
- 仅 then 举例
if exists (select code from xxx) then (select 1) end if if exists (select code from xxx) then (select 1) if exists (select code from xxx) then select 1 if not exists (select code from xxx) then (select 1) end if if not exists (select code from xxx) then (select 1) if not exists (select code from xxx) then select 1
- 仅 else 举例
if exists (select code from xxx) else (select 2) end if if exists (select code from xxx) else (select 2) if exists (select code from xxx) else select 2 if not exists (select code from xxx) else (select 2) end if if not exists (select code from xxx) else (select 2) if not exists (select code from xxx) else select 2
- 同时 then 和 else 举例
if exists (select code from xxx) then (select 1) else (select 2) end if if exists (select code from xxx) then (select 1) else (select 2) if not exists (select code from xxx) then (select 1) else (select 2) end if if not exists (select code from xxx) then (select 1) else (select 2)