Re: Table to Excel - Mailing list pgsql-sql

From Josh Trutwin
Subject Re: Table to Excel
Date
Msg-id 20090326090512.476f2aa4@sinkhole.intrcomm.net
Whole thread Raw
In response to Re: Table to Excel  (Pavel Stehule <pavel.stehule@gmail.com>)
Responses Re: Table to Excel
List pgsql-sql
On Thu, 26 Mar 2009 08:04:25 +0100
Pavel Stehule <pavel.stehule@gmail.com> wrote:

> hello
> 
> use csv format - excel have to read this format without any format
> 
> COPY tablename TO '...' CSV;

Another possibility that I use often is to set the output to HTML
mode using:

\H

Then set to send query results to a file:

\o myresults.html

Then run a single query:

SELECT col1, col2 FROM foo WHERE bar = '1' ORDER BY baz;

\q

Now you can open your .html file directly into Excel since it's just
a big html table.

Josh


pgsql-sql by date:

Previous
From: Pavel Stehule
Date:
Subject: Re: Table to Excel
Next
From: Pavel Stehule
Date:
Subject: Re: Table to Excel