Help with Where Clause using CSV file
916328Feb 8 2012 — edited Apr 11 2013I have the following SQL query:
SELECT
DISTINCT
A.N_LOA,
A.N_COMPNUM,
A.N_MTRSZ_CD,
A.N_ITEMNUM,
A.STATUS,
A.N_METER_SET_DATE,
A.MANUFACTURER,
A.N_MODELNUM,
B.COMMCODE,
B.COMM_NUMBER
FROM
ASSET A, N_METER_TEST_HIST B
WHERE
A.ASSETTYPE = 'ELECTRIC' AND A.SITEID = 'INDIANA' AND A.N_EQTYP_CD = 'METR'
AND A.N_COMPNUM IN ('0986779','0999345','0985123','0912786')
AND A.ASSETNUM = B.ASSETNUM
ORDER BY A.N_COMPNUM
The above query works. However, I am supplied a large (100+) number of meter numbers in a CSV file. Currently I have to cut and paste into this statement. How can I rewrite the where statement so it will read in a CSV file, off my "C" drive for the list of meter numbers?
Any help would be appreciated!!!