Query to select and show data from 2 tables

Hi someone know how get data from two tables and show in a view??? Please help

sql tables?

read something about “joins”…

yes…I used this to get the data from first view and pass to the other one

var itemId = $stateParams.id;
var querySD = “SELECT * FROM Tab_OdL2 WHERE archiviata = 0 AND id = ?”
$rootScope.dettaglio = [];
$cordovaSQLite.execute(db, querySD, [itemId]).then(function(res) {}

in the last view this, but i see just the data from the first, from the second query just the

var query = “SELECT Tabella_OdL.DV_EINDT_ODA AS Tabella_OdL_DV_EINDT_ODA, Tabella_OdL.DV_NETPR_WAERS_POS_ODA AS Tabella_OdL_DV_NETPR_WAERS_POS_ODA, Tabella_OdL.DV_MENGE_MEINS_POS_ODA AS Tabella_DV_MENGE_MEINS_POS_ODA, Tabella_OdL.DV_MATNR_TXZ01_POS_ODA AS Tabella_DV_MATNR_TXZ01_POS_ODA, Tabella_OdL.DV_PEINH_POS AS Tabella_DV_PEINH_POS, Tabella_OdL.DV_NAMECL_POS_ODA AS Tabella_DV_NAMECL_POS_ODA FROM Tabella_OdL LEFT JOIN Tab_OdL2 ON Tabella_OdL.caseFolderId = Tab_OdL2.caseFolderId”;

/*var query = “SELECT t1.DV_EINDT_ODA, t1.DV_NETPR_WAERS_POS_ODA, t1.DV_MENGE_MEINS_POS_ODA, t1.DV_MATNR_TXZ01_POS_ODA, t1.DV_PEINH_POS, t1.DV_NAMECL_POS_ODA FROM Tabella_OdL t1, Tab_OdL2 t2 WHERE t1.caseFolderId = t2.caseFolderId AND t1.stepName LIKE ‘Item details’ AND t1.Archiviata = 0 AND t2.Archiviata = 0”;
*/
$rootScope.divC1 = [];
$cordovaSQLite.execute(db, query, []).then(function(res) {
if(res.rows.length > 0) {

            for(var i = 0; i < res.rows.length; i++) {
                 
               $rootScope.divC1.push({
                id: res.rows.item(i).id,
                caseTaskId: res.rows.item(i).caseTaskId,
                caseFolderId: res.rows.item(i).caseFolderId,     
                stepName: res.rows.item(i).stepName,
                DV_EINDT_ODA: res.rows.item(i).DV_EINDT_ODA,
                DV_NETPR_WAERS_POS_ODA: res.rows.item(i).DV_NETPR_WAERS_POS_ODA,
                DV_MENGE_MEINS_POS_ODA: res.rows.item(i).DV_MENGE_MEINS_POS_ODA,
                DV_MATNR_TXZ01_POS_ODA: res.rows.item(i).DV_MATNR_TXZ01_POS_ODA,
                DV_PEINH_POS: res.rows.item(i).DV_PEINH_POS,
                DV_NAMECL_POS_ODA: res.rows.item(i).DV_NAMECL_POS_ODA, 
                archiviata: res.rows.item(i).archiviata,
                approvata: res.rows.item(i).approvata,
                rifiutata: res.rows.item(i).rifiutata,      
                });
            }
        } else {
            console.log("No results found JOIN");
        }
    }, function (err) {
        console.error(err);
    });

and this is the html

div ng-init=“goDettaglio();gotableTwo()”>
ion-list class=“list”>

    <p>Purchasing Document: </p><p><span class="note2">{{dettagli.DV_EBELN_ODA}}</span></p>
    
    <p>Creation Date: </p><p><span class="note2">{{dettagli.DateCreated | date :"dd/MM/yyyy"}}</span></p>
    
    <p>Purchasing Group: </p><p><span class="note2">{{dettagli.DV_EKGRP_EKNAM_ODA}}</span></p>
    
    <p>Vendor: </p><p><span class="note2">{{dettagli.DV_NAME_ODA}}</span></p>
    
    <p>Total Valure: </p><p><span class="note2">{{dettagli.DV_NETPR_WAERS_ODA}}</span></p>
    
    <p>Name Creator: </p><p style="padding-bottom: 10px"><span class="note2">{{dettagli.DV_NAME_CR}}</span></p>
Posizione 00010
<div ng-init="gotableTwo()">
  <ion-list class="list">    
    <ion-item id="dettaglioList" ng-repeat="callU in divC1" class="wrapword">     
   
    <p>Delivery Date: </p><p><span class="note2">{{callU.DV_EINDT_ODA}}</span></p>
    
    <p>Plant: </p><p><span class="note2">{{}}</span></p>
    
    <p>Net Price: </p><p><span class="note2">{{callU.DV_NETPR_WAERS_POS_ODA}}</span></p>
    
    <p>Quantity: </p><p><span class="note2">{{callU.DV_MENGE_MEINS_POS_ODA}}</span></p>
    
    <p>Material code: </p><p><span class="note2">{{callU.DV_MATNR_TXZ01_POS_ODA}}</span></p>

    <p>Unit price: </p><p><span class="note2">{{callU.DV_PEINH_POS}}</span></p>

    <p>Delivery address: </p><p><span class="note2">{{callU.DV_NAMECL_POS_ODA}}</span></p>
    
    </ion-item>
 /ion-list> 
/div>