Convert Oracle Select to SQL CE Select.

  • ORACLE:

    SELECT * FROM L_RPT_INV_PERSON_INFO WHERE (RPT_INV_ID,RPT_INV_TP) IN (SELECT RPT_INV_ID,RPT_INV_TP FROM L_RPT_INV_INFO where INFORMATION_CHANGED_FLAG='Y')

    What is the equivalent of above query for SQLCE.

    Urgent help Needed.

    Best Regards.

  • SELECT Person.* FROM L_RPT_INV_PERSON_INFO AS Person

    INNER JOIN L_RPT_INV_INFO AS Inv

    ON Person.RPT_INV_ID = Inv.RPT_INV_ID

    AND Person.RPT_INV_TP = Inv.RPT_INV_TP

    WHERE Inv.INFORMATION_CHANGED_FLAG='Y'

  • FYI, that is actually the correct way to write it in Oracle also

  • An EXISTS might be a better choice depending on number of records.

    SELECTp.*

    FROML_RPT_INV_PERSON_INFO AS p

    WHEREEXISTS (SELECT * FROM L_RPT_INV_INFO AS i WHERE i.INFORMATION_CHANGED_FLAG = 'Y' AND i.RPT_INV_ID = p.RPT_INV_ID AND i.RPT_INV_TP = p.RPT_INV_TP)


    N 56°04'39.16"
    E 12°55'05.25"

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply