I am a little new to Oracle, and can't seem to run this query below.
SELECT user_key AS oldKey,
(SELECT
user_key
FROM
user_mapping AS u
WHERE lower(u.username) = u.lower_username
AND lower(u.username) = lower(um.username)
) AS newKey,
um.username,
um.lower_username
FROM user_mapping AS um
WHERE user_key IN (SELECT user_key
FROM user_mapping
WHERE (lower(username) != lower_username))
OR (lower_username is null)
It throws the "ORA-00907: missing right parenthesis" error, but I don't see any syntax error, and the query works fine when I run it against a MySQL database.
Checking some other issues related to the missing parenthesis, but it's mostly about not explicitly stating the primary key, or specifying something as not null, but I don't think that seems to be the issue here as well.
Do let me know if I am missing or am wrong in anything above.
Thank you.