title: Oracle SQL to subtract 2 values from different table joins
body: <p>I am trying to subtract sequences MN_SEQ from Table C generated based on join with other tables. 
  <img src="https://i.stack.imgur.com/twgcn.png" alt="enter image description here">
  Here is the problem. 
  Query 1 -
  Select M_Seq from Table C, Table A, Table B where C.date_sk=A.MTH_END_DT
  and B.Loan_seq=A.Loan_seq</p>
  
  <p>Query 2 - </p>
  
  <p>Select M_Seq from Table C, Table B where C.date_sk=B.ORIG_DT</p>
  
  <p>I have to get difference between 2 M_SEQ generated from the result set of query 1 and Query 2. </p>
  
  <p>Below is what i tried, but I am getting error. </p>
  
  <pre><code>                                                                        select mn_seq -mn_seq from 
      ((select mn_seq from Table C, Table A, Table B where  B.MTH_END_DT=C.DATE_SK and B.LOAN_SEQ=A.LOAN_SEQ)a,
     (select mn_seq from Table C , Table B where B.ORIG_DT=C.DATE_SK
      )b) 
  </code></pre>
  
  <p>T</p>
  
  <p>Kindly provide inputs . I am not sure if this is the right way to do it. I tried just using "-" between queries but didnt work. Thanks!</p>