IN Clause Examples

The following table shows how you can use the IN clause to retrieve data from an external database.  The Customers table is stored in an external database.

External database      SQL statement

 

Microsoft Access        SELECT Customers.[Customer ID],
FROM Customers,
IN MYDATA.MDB
WHERE Customers.[Customer ID] Like "A*"

                                   MYDATA.MDB is the name of a Microsoft Access database containing the Customers table.

dBASE III+ or IV          SELECT CUSTOMERS.CustomerID,
FROM CUSTOMERS
IN "C:\DBASE\DATA\SALES" "dBASE IV;"
WHERE CUSTOMERS.CustomerID Like "A*"

                                   To retrieve data from a dBASE III table, substitute "dBASE III;" in place of "dBASE IV;".

Paradox                      SELECT CUSTOMERS.CustomerID
FROM CUSTOMERS
IN "C:\PARADOX\DATA\SALES" "Paradox;"
WHERE CUSTOMERS.CustomerID Like "A*"

Btrieve                        SELECT CUSTOMERS.CustomerID
FROM CUSTOMERS
IN "C:\BTRIEVE\DATA\SALES\FILE.DDF" "Btrieve;"
WHERE CUSTOMERS.CustomerID Like "A*"

                                   C:\BTRIEVE\DATA\SALES\FILE.DDF is the path and file name of the Btrieve data definition file.