SELECT JIVE_USER_ID,
EMAIL_ID,
USER_ID
FROM VIK_USER WHERE EMAIL_ID='user@example.com';
Result is
JIVE_USER_ID EMAIL_ID USER_ID
11222 user@example.com User
Another query is
SELECT VIK_USER_PROFILE.FIRST_NAME,
VIK_USER_PROFILE.LAST_NAME,
VIK_USER.EMAIL_ID
FROM VIK_USER,VIK_USER_PROFILE
WHERE VIK_USER_PROFILE.USER_ID=VIK_USER.USER_ID;
Result is
FIRST_NAME LAST_NAME EMAIL_ID
Ray User user@exmaple.com
I want to get the result using a single block statement.How can I join these two select statements into one.
Thank You.
To elaborate, VIK_USER and VIK_USER_PROFILE are in an INNER JOIN (the comma is just a shortcut).
The join condition is
VIK_USER_PROFILE.USER_ID=VIK_USER.USER_ID. JOINs have join conditions, usually on columns which share the same values across two tables.Alternatively, the exact same query can be written as such: