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
HI,
is there a way to limit access for some users only to certain records?
e.g. there is a customer table and there are account-managers.
Could I limit account-manager #1 so that he only can access customers
only acording to a flag?
Say I create a relation cu_am ( customer_id,
The issue in both approaches is that if I have two product_ids that
are
viewed same number of times and share the first place as most viewed
products by that user, I'll get only one of them (LIMIT 1 OR MAX() can
only return one row :).
And then, to jump again into my own mouth - your
Hello,
I went this way, but for a large number of user_id's, it's quite slow:
CREATE VIEW v_views AS
SELECT user_id, product_id, count(*) as views
FROM viewlog
GROUP BY user_id, product_id
SELECT
DISTINCT user_id,
(SELECT product_id FROM v_views inn WHERE inn.user_id =
Hello,
the below one help's me to find the data within the two brackets.
SELECT name,(REGEXP_MATCHES(name, E'\\(.+?\\)'))[1] from person;
regexp_matches
(S/o Sebastin )
-
Trying to work with your code -
update
SELECT SUM (
(SELECT i.id_item, 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)
);
No luck. Obviously SUM expects an
Use:
\d tablename
And what I really like about it is the way you can make a guess about the
table name and use * .
postgres-# \d mt*
Table public.mt1
Column | Type | Modifiers
+-+---
id | integer |
Table public.mt2
Column | Type | Modifiers
Hi,
SELECT ct.dat,ct.heur,hp.datmesure,hp.heuremesure,hp.t FROM
calendar_temp as ct
LEFT OUTER JOIN h_part as hp
ON ct.dat = hp.datmesure
AND ct.heur = hp.heuremesure
WHERE
hp.poste_idposte = 275
ORDER BY ct.dat, ct.heur
dat heur datmesure
Hi,
It works, but you should use a recent version:
test=*# select count(1) over (), i from foo;
count | i
---+
8 | 1
8 | 2
8 | 3
8 | 6
8 | 7
8 | 9
8 | 13
8 | 14
(8 rows)
test=*# select version();
Hi,
Is this what you are trying to do?
postgres=# select * from (select count(*) from people ) p, (select
firstname from people)p2;
count | firstname
---+---
5 | Mary
5 | Mary
5 | John
5 | John
5 | Jacob
(5 rows)
I do not know about the performance impact of
Hi,
I don't think so.
Oracle -
SQL select count(*) over () as ROWCOUNT , first_name from people;
ROWCOUNT FIRST_NAME
--
-
---
6 Mary
6 Mary
6 John
6 John
11 matches
Mail list logo