想问一下,下面那样的IF语句应该怎么写,能让里面的第二个IF语句能生效呢?,仅限于筛选B表的SQL语句,求大佬帮解决
SELECT *
FROM DUAL A
WHERE 1 = 1
${IF(LEN(AA)= 0 ,
"AND ROWNUM = (SELECT ROWNUM
FROM DUAL B
AND ROWID = '"+AA+"'
IF(LEN(BB)=0,"AND ROWNUM = 1","AND ROWNUM = '"+BB+"'" )
")}
,'')
FROM DUAL
AND ROWID = '"+AA+"'" +
+")" ,"" )}
${IF(LEN(AA)= 0
,"SELECT SYSDATE
FROM DUAL"
,"SELECT *
AND ROWNUM = (SELECT ROWNUM
AND ROWID = '"+AA+"'"+
+")")}