I have problem integrating NOT EXISTS in my sql query. Let me explain the problem in detail I have four tables : branch_details , transactions,branch_order_relation and branch_pincode_relation.
Here is my SQL query
private static final String SELECT_ORDERS_BY_BRANCH =
"select transaction_id,source_id,destination_id
from transactions,branch_pincode_relation,branch_details,branch_order_relation
where branch_details.branch_email = ?
and branch_details.branch_id = branch_pincode_relation.branch_id
and branch_pincode_relation.origin_pincode = transactions.start_pin
and transactions.parent_transaction_id IS NOT NULL
and transactions.order_status = "+JiffieConstants.PAYMENT_SUCCESS;
There are some transaction_id of transactions table which exists in branch_order_relation (as order_id). So if the transaction_id is present in branch_order_relation we should not select it. Otherwise we need to select it. Can anyone please integrate this in the above SQL query. I tried and google also but not able to come up with solution