Snyder, James, 29.03.2010 18:25:
Thanks for all the dialog on this subject.
My "version" was derived from the postgreSQL's .jar file (specifically named
"postgresql-8.4-701.jdbc4.jar") that I'm using. When I do the following:
select version()
I get the following:
PostgreSQL 8.3.6
Then you
ng to check this out.
Thanks...Jim
-Original Message-
From: pgsql-sql-ow...@postgresql.org [mailto:pgsql-sql-ow...@postgresql.org] On
Behalf Of Thomas Kellerer
Sent: Friday, March 26, 2010 3:15 AM
To: pgsql-sql@postgresql.org
Subject: Re: [SQL] SQL syntax rowcount value as an extra colu
Jayadevan M, 26.03.2010 07:56:
Thank you for setting that right. Apologies for not checking version.
The orginal poster stated that he is using 8.4, so that solution will work for
him.
Thomas
--
Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org)
To make changes to your subscription:
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();
>
In response to Jayadevan M :
> Hi,
> I don't think so.
> Oracle -
> SQL> select count(*) over () as ROWCOUNT , first_name from people;
>
> ROWCOUNT FIRST_NAME
> --
> -
> ---
> 6 Mary
Regards,
Jayadevan
From: Thomas Kellerer
To: pgsql-sql@postgresql.org
Date: 26/03/2010 03:26
Subject: Re: [SQL] SQL syntax rowcount value as an extra column in
the result set
Sent by:pgsql-sql-ow...@postgresql.org
Snyder, James wrote on 25.03.2010 22:33:
> I’m using Postg
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 s
Snyder, James wrote on 25.03.2010 22:33:
I’m using PostgreSQL (8.4.701)
There is no such version.
The current version is 8.4.3
On a side note, Oracle allows the following syntax to achieve the above:
select count(*) over () as ROWCOUNT , first_name from people
The same syntax will work on
2008/12/25 Karl Denninger :
> Assuming a table containing:
>
> name text
> address text
> uri text
>
> I wish to run a query that will return those rows where:
>
> ("name" is not null) AND (distinct) (uri is the same for two or more entries
> AND name is different between the two entries))
>
> Exam
I wrote:
> There's nothing particularly stopping us from supporting
> multiple-argument aggregates, except a lack of round tuits.
BTW, you can actually fake this pretty well in 8.0, by making an
aggregate that uses a rowtype input. For example:
regression=# create type twostrings as (s1 text, s2
Stephan Szabo <[EMAIL PROTECTED]> writes:
> On Thu, 5 Aug 2004, Ram Nathaniel wrote:
>> 2) aggregated concatenation:
> Theoretically, you should be able to do this right now in PostgreSQL with
> user defined aggregates (although you can't pass a second argument
> currently for the separator).
The
On Thu, 5 Aug 2004, Ram Nathaniel wrote:
>
> 1) The operator "of max":
> suppose I have a table "grades" of 3 fields: class/student/grade where I
> store many grades of many students of many classes. I want to get the
> name of the highest scoring student in each class. Note that there may
> be m
Hi Doris,
In oracle (+) is left outer join or right outer join .
You need to write:
select...
fromauswahlkatalog k, beteiligter b left outer join anspruchkorrektur a
on(b.bet_id = a.bet_idemp) left outer join v_betkorr f on (a.ask_id = f.ask_id)
where k.awk_id = a.awk
sad wrote:
select...
fromauswahlkatalog k, anspruchkorrektur a, beteiligter b, v_betkorr f
where k.awk_id = a.awk_id and b.bet_id(+) = a.bet_idemp
and a.ask_id = f.ask_id(+)
This (+) means JOIN
Means OUTER JOIN but I don't remember the side.
e.g.
> I've got a problem in porting the following select statement from Oracle to
> Postgres, because of the characters after "b.bet_id" and "f.ask_id" in the
> where clause: (+)
> I don't know what these characters mean and how I can transform these into
> PostgreSql Syntax.
>
>
> select...
>
This kind of conditions are left or right joins, depending on which side of the equal sign you have the (+).
Something like this
select ...
from
auswahlkatalog k,
INNER JOIN anspruchkorrektur a ON (k.awk_id = a.awk_id),
LEFT JOIN beteiligter b ON (b.bet_id = a.bet_idemp),
RIGHT JOI
Elizabeth O'Neill's Office Mail wrote:
I have two tables in my database a complaint table and a resolution table.
One complaint may have several resolutions. I am trying to build a report
that will give me the complaint details and all the resolution descriptions
for a complaint in one text area/r
On Tue, Dec 10, 2002 at 12:27:34PM +, Elizabeth O'Neill's Office Mail wrote:
> Hi
>
> Can someone please help me.
>
> I have two tables in my database a complaint table and a resolution table.
> One complaint may have several resolutions. I am trying to build a report
> that will give me the
Well It's Friday and I am still geting vacation messages from
Bob
Tom Lane wrote:
>
> Jean-Luc Lachance <[EMAIL PROTECTED]> writes:
> > Can someone *please* temporarely remove
> >"Bob Powell" <[EMAIL PROTECTED]>
> > from the list so we do not get a vacation message for eve
On Wed, 31 Jul 2002, Mindaugas Riauba wrote:
>
> I have two similar tables with host and services availability
> data (Nagios). And I want to find out services which are not OK
> in first table and OK in second one. Query I used is:
>
> select c.* from coll_servicestatus as c inner join
> serv
To help you understand SQL I should point out that your version would
work (assuming only 1 school per person) if you just left the friends
out of the FROMs for the sub-selects:-
select frienda, friendb from friends where
(select schools.school from schools as schoolsa where friends.frienda =
sc
Mike,
> select frienda, friendb from friends where (select
> schools.school from friends,schools where friends.frienda =
> schools.person) = (select schools.school from friends,schools where
> friends.friendb = schools.person);
Too complicated. You need to learn how to use JOINS and table alias
22 matches
Mail list logo