Hello Community,
I was wondering if is there a way to retrieve only the values of a single table based on the conditions from other tables. Something equivalent to SQL
SELECT
TableA.* /*ONLY I want TableA*/
FROM
TableA INNER JOIN
TableB ON TableA_BID = TableB_BID /*Join TableA & TableB - One-to-one Relation in my case*/
WHERE
TableB_CID IN (SELECT TableC_CID FROM TableC WHERE TableC_CD = 'MyCondition') /*Filter Result Based on TableC*/
I know I can join tables and apply conditions in the WHERE statement, (for Example if I Join APInvoice with APTran) but the problem is when I join tables I will have the redundant APInvoice per APTran line and I want to avoid it also I do not want the APTran fields. I also know I can perform GroupBy but it is a headache and in my opinion, a dumb way to approach it.
I only want to return a single table and its records that meet the criteria from other tables without redundancy caused by joining with other tables.
Best answer by aaghaei
View original