O/P - 1
O/P - 2
O/P - 3
When I directly query the comments table with a filter to fetch comments where the audit is null, it returns the expected results(O/P - 1). However, when I apply the same filter in a related record query from the main test table, it does not return any comments(O/P - 2). Interestingly, if I remove the audit filter, the related record query returns the correct data(O/P - 3). Any idea what could be causing this issue?
Discussion posts and replies are publicly visible
As per your query, you mentioned that the "is null" filter fails to return results in a related record query. However, I tried to replicate this scenario, and in my case, the "is null" filter works as expected for related records.
Could you please clarify your setup or provide more details about the issue you are facing?
Test (id, commentId)
one to many through test_id
Comment (comment_id, test_id)
one to one through comment_id
Audit (audit_id, comment_id)
I need comments with null audit. Its working when we directly query comment(O/P - 1) but its not not working if I apply same filter in related record(O/P - 2).