Note that there are some explanatory texts on larger screens.

plurals
  1. POMS ACCESS SQL Table Merge
    primarykey
    data
    text
    <p>Table1 </p> <pre><code>Acct Numb Account Type Asset Mkt Val Acct Asset MV --------- ------------ ------------- ------------- 881009201 Main Account 30 120 881009201 Main Account 40 120 881009201 Main Account 20 120 881009201 Main Account 30 120 881009203 Sub Account 50 80 881009203 Sub Account 10 80 881009203 Sub Account 20 80 </code></pre> <p>Table2 </p> <pre><code>Acct Numb Account Type Asset Mkt Val Acct Asset MV --------- ------------ ------------- ------------- 881009201 Main Account 30 200 881009201 Main Account 40 200 881009201 Main Account 20 200 881009201 Main Account 30 200 881009201 Sub Account 80 200 </code></pre> <p>I have Table1 with the information given above. I have 2 types of accounts: </p> <ol> <li>Main Account (ending with 01) </li> <li>Sub Account (ending with 03)</li> </ol> <p>Now, I need a table that has all of the Main Accounts as well as Sub Accounts merged together into a single Account Number, where the Account Number will be the same as its Main Account Number, but the Account Type will be <code>Sub Account</code>.</p> <p>Now we have 2 more columns:</p> <ol> <li>Asset Mkt Val</li> <li>Acct Asset MV</li> </ol> <p>In Table 1: The column <code>Acct Asset MV</code> shows the sum of Main Account (30 + 40 + 20 + 30 = 120) and <code>Asset Mkt Val</code> shows the sum of Sub Account (50 + 10 + 20 = 80).</p> <p>Now in Table 2: I want to have <code>Acct Asset MV</code> contain the sum of all accounts (120 + 80 = 200) and in Sub Account the [Asset Mkt Val] should be 80. </p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload