In PostgreSQL, you always connect to a 'database', then query tables. So if
you are connecting to the 'wrong' database, you will get the error you
mentioned. You can troubleshoot this in many ways -
one way would be to enable logging on PostgreSQL side and check the log and
see which database you a
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
uses some other client like psql.
Using a VIEW?
Regards,
Jayadevan
DISCLAIMER:
"The information in this e-mail and any attachment is intended only for
the person to whom it is addressed and may contain confidential and/or
privileged material. If you have received this e-mail in error
ant to compare and ensure that the values are same for all
columns, please have a look at INTERSECT
http://www.postgresql.org/docs/9.1/static/sql-select.html
Regards,
Jayadevan
DISCLAIMER:
"The information in this e-mail and any attachment is intended only for
the person to whom
> And then, to jump again into my own mouth - your approach, Jayadevan,
> correctly gives me both product_id's if they're viewed the same number
> of times.
>
Good. It should, since we are joining on count and user_id. I was
surprised to see your mail which said it wouldn
as y
on x.user_id=y.user_id and x.count=y.count1
Regards,
Jayadevan
DISCLAIMER:
"The information in this e-mail and any attachment is intended only for
the person to whom it is addressed and may contain confidential and/or
privileged material. If you have received this e-mail in error, ki
dnesday | 5
2010-12-30 | Thursday | 5
2010-12-31 | Friday| 5
Regards,
Jayadevan
DISCLAIMER:
"The information in this e-mail and any attachment is intended only for
the person to whom it is addressed and may contain confidential and/or
privileged material. If you have recei
and after the pattern
and concatenating them . Please see documentation for proper use of
substr,strpos,cahr_length etc.
Regards,
Jayadevan
DISCLAIMER:
"The information in this e-mail and any attachment is intended only for
the person to whom it is addressed and may contain confi
i.price, SUM (o.quantity), ROUND (SUM (o.quantity) *
i.price, 2) AS cost
FROM orders o
JOIN items i ON i.id_item = o.id_item
WHERE o.date_order BETWEEN '2010-01-01' AND '2010-01-31'
GROUP BY i.id_item, i.price)
) as x
Regards,
Jayadevan
DISCLAIMER:
"The inform
.mt2"
Column | Type | Modifiers
+-+---
id | integer |
Table "public.mt3"
Column | Type | Modifiers
+-+---
id | integer |
Regards,
Jayadevan
DISCLAIMER:
"The information in this e-mail and any attachment is
| 2008-03-15 | 00:00:00| 8.3
2008-03-15 | 03:00:00 | 2008-03-15 | 03:00:00| 12.0
2008-03-15 | 06:00:00 | 2008-03-15 | 06:00:00| 15.0
2008-03-15 | 09:00:00 | 2008-03-15 | 09:00:00| 18.0
2008-03-15 | 12:00:00 || |
2008-03-15 | 15:00:00 |
guess - over () will be better. My query does sequential
scans/nested loop...(if there are no indexes)
Regards,
Regards,
Jayadevan
DISCLAIMER: "The information in this e-mail and any attachment is intended
only for the person to whom it is addressed and may contain confidential and/or
pr
6 John
6 John
6 Jacob
6 rows selected.
PostgreSQL
postgres=# select count(*) over () as ROWCOUNT , first_name from people;
ERROR: syntax error at or near "over"
LINE 1: select count(*) over () as ROWCOUNT , first_name from people...
^
such a query (cartesian
join)
Regards,
Jayadevan
From: "Snyder, James"
To:
Date: 26/03/2010 03:21
Subject:[SQL] SQL syntax rowcount value as an extra column in the
result set
Sent by:pgsql-sql-ow...@postgresql.org
Hello
I’m using PostgreSQL (8.4.701) and
14 matches
Mail list logo