I'm having a bit of a problem with a SQL Query that returns too many results. I'm fairly new to SQL so please bear with me.
Please see the following:
The Query that I use looks like:
and TABLE_A.COMMON_ID = '123456789'
You want data from TABLE_B? Then select from it only and have the conditions on the other tables in your where clause.
The inner joins on the other tables serve as existence tests, I assume? Don't do that. You'd only multiply your records, just as you are doing now, only to have to dismiss duplicates later. That can cause bad performance on large tables and errors in more complicated queries. Use
select * from table_b where item_status <> 'C' and (common_id, seq_3c) in ( select common_id, seq_3c from table_a where checklist_status = 'I' and admin_function = 'ADMA' and checklist_cd = 'APPL' ) and common_id in ( select EMPLID from table_c where admit_term = '2171' and institution = 'SOMEWHERE' );