首页 > 代码库 > Access导出CSV的SQL

Access导出CSV的SQL

Select * INTO [TEXT;CharacterSet=65001;FMT=CSV;DELIMITED;HDR=YES;DATABASE=E:\temp\].test.csv FROM tablename

另外,向Postgre中导入CSV

copy tablename(item,...) from ‘e:\temp\.test.csv‘ with csv header quote ‘"‘;

COPY tablename [ ( column [, ...] ) ]
    FROM { ‘filename‘ | STDIN }
    [ [ WITH ]
          [ BINARY ]
          [ OIDS ]
          [ DELIMITER [ AS ] ‘delimiter‘ ]
          [ NULL [ AS ] ‘null string‘ ]
          [ CSV [ HEADER ]
                [ QUOTE [ AS ] ‘quote‘ ]
                [ ESCAPE [ AS ] ‘escape‘ ]
                [ FORCE NOT NULL column [, ...] ]