I want to fetch crimes from crm_ms_fir table where condition should be based on category of crime database detail →
crm_ms_fir(fir_id,crime_id)
crm_ms_crime(crime_id,crime_category_id,crime_name)
crm_ms_category(category_id,category_name)
Example: give me all fir reports where crime came under crime_category_id = 2
SELECT fir.fir_id,
fir.crime_id,
crm.crime_name
FROM crm_ms_fir fir
INNER JOIN crm_ms_crime crm
INNER JOIN crm_ms_crime_category
ON crm.category_id=3
This the sample query which I have written .