I have 3 tables
Account
acc_id
acc_name
acc_status
acc_owner_id
User
role_id
user_name
Sub_Contract_ID
basic_con_id
start_date
end_date
also,
Account.acc_owner_id = User.role_id
I want the result to contain
acc_id
acc_name
acc_status
user_name
basic_con_id
start_date
end_date
WHERE acc_status = "Inactive"
I did try a way but was getting stuck at how I can pull user_name
using Account.acc_owner_id = User.role_id
and fit it into the main query
This is what I tried:
SELECT
Account.acc_id,
Account.acc_name,
Account. acc_status,
Sub_Contract_ID.basic_con_id,
Sub_Contract_ID.basic_con_id.start_date,
Sub_Contract_ID.end_date
FROM
(
Account,
User,
Sub_Contract_ID)
WHERE Account. acc_status = “Inactive”
Please advise!