search

Home  >  Q&A  >  body text

Application of subtracting numerical values ​​in different tables

<p>I have two tables:</p> <pre class="brush:php;toolbar:false;">Table A ID Number Profile 1 100 Baker 2 75 Fields 3 100 Wayward Table B ID Number Tag Sender 1 50 on chris 2 50 off james</pre> <p>I am trying to subtract values ​​with the same ID number from table A and table B</p> <pre class="brush:php;toolbar:false;">Table C ID Number 1 50 2 25</pre></p>
P粉854119263P粉854119263458 days ago380

reply all(1)I'll reply

  • P粉465287592

    P粉4652875922023-08-29 10:19:06

    SELECT A.ID,A.NUMBER-B.NUMBER DIFF
    FROM TABLE_A AS A
    JOIN TABLE_B AS B ON A.ID=B.ID

    reply
    0
  • Cancelreply