Hi everyone, I’m using sqllite for my KMM project....
# squarelibraries
p
Hi everyone, I’m using sqllite for my KMM project. My query is something like this:
Copy code
CREATE VIEW IF NOT EXISTS FinalView AS
SELECT
    a.id,
    a.id1,
    a.id2,
    b.id,
    b.id1,
    b.state,
    c.id,
    c.id1,
    c.version,
    d.id
FROM
    A a
    LEFT JOIN B b
        ON b.id =  a.bId
    INNER JOIN C c ON c.id = b.cId
        AND c.version = a.version
    LEFT JOIN (SELECT * FROM D d
                      WHERE d.state = 'COMPLETED'
                      AND d.id = b.dId
                      AND d.id2 = a.id2
                      ORDER BY d.sessionNo DESC LIMIT 1) AS dLast ON d.id2= a.id2
        AND d.version = a.version
;
In this I’m facing an issue where AndroidStudio is saying that it is not able to find table b and d in my subquery statement. Can someone please let me know what I’m doing wrong here?
h
Could you try it by writing
AS
explicitly?