i`m using this SQL query to populate a database:
CREATE TEMP TABLE tmp_x AS SELECT * FROM testcsv LIMIT 0; -- but see below
COPY tmp_x FROM 'D:\water_utility.csv' (header, FORMAT CSV, ENCODING 'WIN1251');
insert into testcsv select * from (
select x.*
from tmp_x x
left outer join testcsv t on t. timestamp = x. timestamp
where t. timestamp is null
) as missing;
DROP TABLE tmp_x; -- else it is dropped at end of session automatically
Can you help me by giving advice how to get all files from folder named like this and populate the table with data:
sample_1.csv sample_2.csv ... sample_12.csv
The numbers are the months that are created the files. How to create auto populate script?