"Pascal Tufenkji" <[EMAIL PROTECTED]> writes:
> I understand the fact that "the inner query is executed before the outer
> query and the inner query doesn't even know about the outer query."
>
> But why the following query can be executed, although the inner query is
> using the outer query.
>
>
53 PM
To: [EMAIL PROTECTED]
Cc: pgsql-sql@postgresql.org
Subject: Re: [SQL] Subqueries
The "v" reference need to exist in the inner query. You can't use an "outer
query reference" in the inner query.
This happens because the inner query is executed before the outer query and
The "v" reference need to exist in the inner query. You can't use an "outer
query reference" in the inner query.
This happens because the inner query is executed before the outer query and
the inner query doesn't even know about the outer query.
May be this helps you get what you want.
SELECT *,
alias v not visible in sub-query?
- Original Message -
From: Pascal Tufenkji
To: pgsql-sql@postgresql.org
Sent: Thursday, October 30, 2008 12:17 PM
Subject: [SQL] Subqueries
Hello,
I don't understand the following error.
Can anyone help me plz
Thx
Pascal
hi,
Adam Witney wrote, On 5/11/2004 02:09:
Hi,
I am using a function in a subquery, this works ok:
SELECT name, (SELECT p_my_func(1)) AS id
FROM test;
However I would like to have the function return 2 values into the main
query... Something like this:
SELECT name, (SELECT p_my_func(1)) AS (id
"Josh Berkus" <[EMAIL PROTECTED]> writes:
> Until you can upgrade, though, try this approach:
> CREATE VIEW c_aggregate AS
> SELECT sum(a) as sum_a, b FROM c GROUP BY b;
> SELECT max(sum_a) FROM c_aggregate;
Unfortunately that won't work in 7.0 --- grouped views have a lot of
problems in that v
Sara,
Hey! Great to see that Postgres has made it to Israel. What's the
most popular Linux distribution there?
I think you have your answer ... an upgrade. RPMs for most major
distributions of Linux should be available within the week.
Until you can upgrade, though, try this approach:
CREA
Sara Cohen <[EMAIL PROTECTED]> said:
> Hi,
>
> I am attempting to use subqueries in the select clause of a query
> and am encountering difficulties.
>
> The Problem:
>
>
> I would like to use a subquery that returns one column, but more than one
> tuple. The result of this subquer
On Wed, 18 Apr 2001, Sara Cohen wrote:
> The Problem:
>
>
> I would like to use a subquery that returns one column, but more than one
> tuple. The result of this subquery is then used in an aggregate function.
>
> For example, suppose I have a table c, with columns a and b of
> num
Sara Cohen <[EMAIL PROTECTED]> writes:
> Using Oracle, I could get by this problem with:
> select max(d) from ((select count(b) as d from c group by a));
> However, my version of postgres doesn't support subqueries in the from
> clause.
Time to update to 7.1...
rega
Christof Glaser wrote:
[ . . . ]
> since the where clause compares just one field for equality. You might
> try IN instead of =, ie
>
> update index set level = 2 where parentid in ( select id from
> index where level = 1 );
That was it! Thanks, Frank
Frank Joerdens <[EMAIL PROTECTED]> writes:
> mpi=# update index set level = 2 where parentid = ( select id from
> index where level = 1 );
> ERROR: More than one tuple returned by a subselect used as an expression.
Apparently the subquery "select id from index where level = 1" is
returning more
Frank Joerdens wrote:
> mpi=# update index set level = 2 where parentid = ( select id from
> index where level = 1 );
> ERROR: More than one tuple returned by a subselect used as an
> expression. mpi=#
>
> This is a recursive query, on a single table. Is that not possible?
Hi Frank,
as the err
Hi,
The syntax you used works fine for me.
francis=# select version();
version
---
PostgreSQL 7.0.2 on i686-pc-linux-gnu, compiled by gcc 2.95.2
(1 row)
Hope this helps
Francis Solomon
> -Original Mes
Pierre Habraken <[EMAIL PROTECTED]> writes:
> It looks like if subqueries in from clause are not supported by
> PostgreSQL. Am I right ? If yes, are there any plans to provide this
> feature soon ?
Already there in current sources for 7.1 ...
regards, tom lane
Meszaros Attila <[EMAIL PROTECTED]> writes:
> How far is the above subject from beeing implemented?
I'm looking at it right now ... no promises yet, though.
regards, tom lane
16 matches
Mail list logo