Hello all ,
I have a similar situation - an EAV table.
entity_attr_id integer
entity_id bigint
ent_attr_value character varying
I am trying
select * from crosstab('select entity_id::text as row_name,
entity_attr_id::bigint as entity_attr_id , ent_attr_value::text as
2012/3/12 John Fabiani :
> select *
> from crosstab('select item_number::text, week_of::date, planned_demand::text
> from holding_table order by 1,2')
> as ct(row_name text, week_of date, planned text)
>
> The above does not work. What am I doing wrong?
what it does?
do you have tablefunc exten
select *
from crosstab('select item_number::text, week_of::date, planned_demand::text
from holding_table order by 1,2')
as ct(row_name text, week_of date, planned text)
The above does not work. What am I doing wrong?
Johnf
On Monday, March 12, 2012 06:01:21 PM Pavel Stehule wrote:
> Hello
>
>
Hello
maybe this article helps
http://stackoverflow.com/questions/3002499/postgresql-crosstab-query
there are more ways
Regards
Pavel Stehule
2012/3/12 John Fabiani :
> Hi,
> I don't know if it because I'm as sick as dog or I'm just a plain idiot - most
> likely a little of both.
>
> Here is
Hi,
I don't know if it because I'm as sick as dog or I'm just a plain idiot - most
likely a little of both.
Here is my table
week_of date,
item_number text,
planned_demand integer.
I have
week_ofitem_number planned
2012-02-125200
2012-02-195
Hi Folks,
I have one that I need your advise on how to construct.
I have the need to create a series of dates starting from a Sunday - one week
apart.
(select ((date_trunc('week', '2012-02-12'::date)::date) +(i+6)) as week_date
from
generate_series(0,84,7) i) as foo
that gives a table of sun
sprüngliche Nachricht-
> Von: pgsql-sql-ow...@postgresql.org [mailto:pgsql-sql-ow...@postgresql.org]
> Im Auftrag von John Fabiani Gesendet: Freitag, 24. Februar 2012 09:39
> An: pgsql-sql@postgresql.org
> Betreff: Re: [SQL] crosstab help
>
> That worked! However, I need the actual
Gesendet: Freitag, 24. Februar 2012 09:39
An: pgsql-sql@postgresql.org
Betreff: Re: [SQL] crosstab help
That worked! However, I need the actual date to be the column heading? And
of course the dates change depending on the date passed to the function:
xchromasun._chromasun_totals(now()::date
> Von: pgsql-sql-ow...@postgresql.org [mailto:pgsql-sql-ow...@postgresql.org]
> Im Auftrag von John Fabiani Gesendet: Freitag, 24. Februar 2012 09:11
> An: pgsql-sql@postgresql.org
> Betreff: [SQL] crosstab help
>
> I have a simple table
> item_number week_of
Gesendet: Freitag, 24. Februar 2012 09:11
An: pgsql-sql@postgresql.org
Betreff: [SQL] crosstab help
I have a simple table
item_number week_of planned_qoh
-- -- --
5 2012-02-05 30
5
I have a simple table
item_number week_of planned_qoh
-- -- --
5 2012-02-05 30
5 2012-02-12 40
5 2012-02-19 50
where
item_number text
week_of date
planned
On Mon, Feb 1, 2010 at 3:11 PM, Adam Sherman wrote:
> Actually, the query I was running is:
>
> SELECT
>cust_id as customer,
>date_trunc(''day'', date) AS day,
> SUM(billed_duration)/60.0::numeric(10,4) AS minutes
>
> billed_duration is an integer. Make sense?
>
> If billed_duration i
On 2010-02-01, at 14:22 , Lee Hachadoorian wrote:
> The output column data type (day1, day2, etc.) is supposed to match the value
> data type. I used numeric(10,4) because that's what your original post
> specified, but the billed_duration column in your most recent post looks like
> it might be
The output column data type (day1, day2, etc.) is supposed to match the
value data type. I used numeric(10,4) because that's what your original post
specified, but the billed_duration column in your most recent post looks
like it might be integer? (Or is it defined as numeric(10,4), but you never
e
On 2010-02-01, at 11:34 , Lee Hachadoorian wrote:
> You basically have three parts:
>
> 1) SELECT query in the form (row header, column header, cell value). In this
> case it is an aggregate query so that you can sum the transactions over a
> given day.
>
> 2) List of column headers. If you wa
I'm flying blind here since I have nothing that looks like the structure you
described to experiment on, but based on some crosstabs I have set up this
should get you started. Explanatory notes follow.
SELECT pivot.*
FROM crosstab('
--row header, column header, cell value
SELECT customer_i
I'm really trying to understand how the tablefunc crosstab function works, to
no avail.
I have a table that looks like this:
customer_id integer
date timestamp with time zone
amount numeric(10,4)
There are rows in this table every-time a customer gets charged an amount,
which is multiple times
"Chris Preston" <[EMAIL PROTECTED]> writes:
> I am almost a newbie to postgres and only recently found out about one of
> the greatest function crosstab in postgres. The problem is that I am using
> 8.1 and when I run the function I am getting an error relating to
> $libdir/tablefunc.. someone
Hello,
I am almost a newbie to postgres and only recently found out about one of
the greatest function crosstab in postgres. The problem is that I am using
8.1 and when I run the function I am getting an error relating to
$libdir/tablefunc.. someone mentioned that it might be because I am usin
"ronald tabada" <[EMAIL PROTECTED]> writes:
> ... when I tried
> producing reports with more than 17 columns it displayed the following
> error message:
> ERROR: invalid return type
> SQL state: 42601
> Detail: Query-specified return tuple has 39 columns but crosstab returns 17.
Worksforme. Mayb
Good day... I'm new in postgresql and I used PostgreSQL 8.2. I tried
generating a query that can convert rows into columns. I was
happy when I discovered the crosstab function. But when I tried
producing reports with more than 17 columns it displayed the following
error message:
ERROR: invalid ret
On Sun, Oct 22, 2006 at 01:57:09PM +0200, Leendert Paul Diterwich wrote:
> The problem is that the data is being shifted when there is no
> price for Supplier1 for product 3:
>
> Productnumber Supplier1 Supplier2
> 2 0.80.9
> 3
Dear list,
I recently discovered the crosstab function in postgresql.
What I’m trying to accomplish is turn this:
Suppliernumber Productnumber Price
0
2
0.8
0
3
1.2
1
2
Hi, Bandeng,
bandeng schrieb:
> I have install postgresql-contrib finally... i'm newbie in server.
> I use freebsd 4.8, I saw in documentation it is said use tablefunc.sql
> but in freebsd i found file tablefunc.so , it is already compiled. is
> there suggestion to install tablefunc.so ?
I think
I have install postgresql-contrib finally... i'm newbie in server.
I use freebsd 4.8, I saw in documentation it is said use tablefunc.sql
but in freebsd i found file tablefunc.so , it is already compiled. is
there suggestion to install tablefunc.so ?
Thank you
Ricky
On Apr 6, 2005 3:32 PM, Andrea
am 06.04.2005, um 13:55:35 +0700 mailte bandeng folgendes:
> hello guys,
>
> I want to use crosstab function but that function it doesnt exist. my
> version is 7.3 so how do i get the tablefunc.sql from postgre contrib?
apt-get install postgresql-contrib
Regards, Andreas
--
Andreas Kretschmer
bandeng wrote:
hello guys,
I want to use crosstab function but that function it doesnt exist. my
version is 7.3 so how do i get the tablefunc.sql from postgre contrib?
i saw in ver 8 win32 is checkable.
Is it not in the contrib/ directory? Or did you install from a package
of some sort (and if so,
hello guys,
I want to use crosstab function but that function it doesnt exist. my
version is 7.3 so how do i get the tablefunc.sql from postgre contrib?
i saw in ver 8 win32 is checkable.
Thanks
Ricky
--
Gutten Aben Sugeng Sonten, Jangane Kurang Santen
bandeng
-
THeo,
> I have tried using unions or subselects however the table is quite large
> and it takes far too long to run. The most efficient way would be to create
> a stored proc that uses a cursor to loop through the table transforming the
> data into the new table structure. However I would apprecia
Title: crosstab
Hi I have looked into the tablefunc / crosstab contrib for postgres and it appears like it can't perform what I need.
The crosstab function converts this :
row_name cat value
--+---+---
row1 cat1 val1
Adam Witney wrote:
The missing values seemed to have been ignored and so the data is being
shifted to the left and so put in the wrong columns.
Am I using this function correctly? What is supposed to happen with missing
values?
Yeah, that's a limitation of the version of crosstab distributed with
Hi,
I am trying to figure out the use of crosstab(text sql, int N)
The sql I have is
cabbage=# select geneid, bioassay_id, sig_median from imagene order by 1,2;
geneid | bioassay_id | sig_median
-+-+
16s rRNA (AP
> Richard,
>
>> I have a table containing milestones achieved for projects, marked as
>> being in particular quarters.
>>
>> CREATE TABLE milestones (
>> proj_id int4,
>> sortorder SERIAL,
>> qtr int4,
>> description varchar(200)
>> );
>>
>> Now I need the milestone de
Richard,
> I have a table containing milestones achieved for projects, marked as
> being in particular quarters.
>
> CREATE TABLE milestones (
> proj_id int4,
> sortorder SERIAL,
> qtr int4,
> description varchar(200)
> );
>
> Now I need the milestone descriptions o
TIA all
I have a table containing milestones achieved for projects, marked as
being in particular quarters.
CREATE TABLE milestones (
proj_id int4,
sortorder SERIAL,
qtr int4,
description varchar(200)
);
Now I need the milestone descriptions output across the page l
35 matches
Mail list logo