I want to join two tables based on the below scenarios:
Need to display all the requirements table values
Join the second table(prod_spec) based on the requirement_id and inquiry_id.
Table 1(requirements):
Table 2(prod_spec):
Using below query I'm getting the result below:
SELECT requirements.id,requirements.requirement, prod_spec.evidence,prod_spec.status,prod_spec.no_specify,prod_spec.inquiry_id FROM requirements LEFT JOIN product_spec ON prod_spec.requirement_id=requirement.id
The problem is not getting any result when I put the where condition eg: where inquiry_id='67' to the sql query. Please let me know how to display the rows based on inquiry_id.
FYI, requirement_id will only there once in prod_spec table based on inquiry_id.