I'm learning SQL as a because it is almost impossible to get service from Oracle. I've written the following query which runs but it creates duplicates. The 4th Inner Join seems to be the one that makes the duplicates show up. I'm pretty sure there is a much better way to write this query. Any help is appreciated.
SQL:
SELECT sale_dtl.trans_seq, sls_itmzr_01, sls_itmzr_02, sls_itmzr_03, sls_itmzr_04, sls_itmzr_05, sls_itmzr_06, sls_itmzr_07, sls_itmzr_08, txbl_sls_itmzr_02, txbl_sls_itmzr_07, tax_itmzr_02, tax_itmzr_07,
sale_dtl.other_svc_ttl, net_sls_ttl, item_dsc_ttl, tax_coll_ttl, credit_ttl, non_txbl_ttl, rounding_ttl, change_grand_ttl, sale_dtl.pymnt_ttl, sale_dtl.gross_rcpts, chg_rcpts_ttl, charged_tip_ttl, cur_ot_net_sls_ttl,
prev_ot_net_sls_ttl, sale_dtl.amt_due_ttl, incl_tax_by_chk_itmzr_02, incl_tax_by_chk_itmzr_07, chk_begun_ttl, trans_dtl.trans_seq, trans_dtl.chk_seq, chk_dtl.chk_num, dtl.dtl_seq, dtl.dtl_type,
dtl.dtl_name, dtl.rpt_inclusive_tax_ttl_ex, mi_dtl.maj_grp_seq, maj_grp_def.name, mi_dtl.fam_grp_seq, fam_grp_def.name
FROM micros.sale_dtl
INNER JOIN micros.trans_dtl on micros.sale_dtl.trans_seq = micros.trans_dtl.trans_seq
Inner join micros.chk_dtl on micros.trans_dtl.chk_seq = micros.chk_dtl.chk_seq
INNER JOIN micros.dtl on micros.trans_dtl.trans_seq = micros.dtl.trans_seq
INNER JOIN micros.mi_dtl on micros.sale_dtl.trans_seq = micros.mi_dtl.trans_seq
INNER JOIN micros.maj_grp_def on micros.mi_dtl.maj_grp_seq = micros.maj_grp_def.maj_grp_seq
INNER JOIN micros.fam_grp_def on micros.mi_dtl.fam_grp_seq = micros.fam_grp_def.fam_grp_seq
where trans_dtl.trans_seq = '957021'