我需要为 SQLite 转换以下表达式,知道该怎么做吗?
IF EXISTS (SELECT [ID] FROM [USERS] WHERE [ID]=1)
SELECT [ID], [NAME], [CITY] FROM [USERS] WHERE [ID]=1
ELSE
SELECT NULL AS ID, NULL AS NAME, NULL AS CITY
UNION ALL
IF EXISTS (SELECT [ID] FROM [USERS] WHERE [ID]=2)
SELECT [ID], [NAME], [CITY] FROM [USERS] WHERE [ID]=2
ELSE
SELECT NULL AS ID, NULL AS NAME, NULL AS CITY
换句话说,当条件不符合条件时,我需要返回一个空行,其中包含具有 NULL 值的必要列。