WHERE 条件中的 OpenSQL 语法 CASE 语句
OpenSQL syntax CASE statement in WHERE condition
请问是否可以将CASE语句直接写入WHERE子句中(我知道WHERE子句也可以通过字符串传递)例如
SELECT * FROM db_table INTO TABLE @mt_table[]
WHERE key1 = @l_key1
AND key2 = @l_key2
AND key3 = @l_key3
AND key4 = @l_key4
AND ( WHEN l_auth = 'A' THEN username = @sy-uname
WHEN l_auth = 'U' THEN username = @sy-uname OR username = @space
END ).
您可以在 WHERE 子句中使用 OR 运算符。
SELECT * FROM db_table INTO TABLE @mt_table[]
WHERE key1 = @l_key1
AND key2 = @l_key2
AND key3 = @l_key3
AND key4 = @l_key4
AND ( ( l_auth = 'A' AND username = @sy-uname )
OR ( l_auth = 'U' AND ( username = @sy-uname OR username= @space ) )
).
我没有在 Open Sql 的 where 子句中找到任何支持案例的文档。
请问是否可以将CASE语句直接写入WHERE子句中(我知道WHERE子句也可以通过字符串传递)例如
SELECT * FROM db_table INTO TABLE @mt_table[]
WHERE key1 = @l_key1
AND key2 = @l_key2
AND key3 = @l_key3
AND key4 = @l_key4
AND ( WHEN l_auth = 'A' THEN username = @sy-uname
WHEN l_auth = 'U' THEN username = @sy-uname OR username = @space
END ).
您可以在 WHERE 子句中使用 OR 运算符。
SELECT * FROM db_table INTO TABLE @mt_table[]
WHERE key1 = @l_key1
AND key2 = @l_key2
AND key3 = @l_key3
AND key4 = @l_key4
AND ( ( l_auth = 'A' AND username = @sy-uname )
OR ( l_auth = 'U' AND ( username = @sy-uname OR username= @space ) )
).
我没有在 Open Sql 的 where 子句中找到任何支持案例的文档。