[SQL] cumulative sum in aggregate query.

2001-07-10 Thread David Stanaway
Hi there, I have a query that gives me x/y data for a graph, and at the moment, the y data is relative. EG: x | y 1.2 | +1 1.9 | 0 3.4 | +4 5.2 | -2 6.7 | -1 9.3 | 0 11.3| -1 Now, I want to convert this result into a result like this: x | y 1.2 |

RE: [SQL] SQL question

2001-07-10 Thread Robby Slaughter
Deepali, Bruce Momjian's book on SQL provides a great intro to SQL, including joins. http://www.ca.postgresql.org/docs/aw_pgsql_book/ If you have a specific question, please post that to a list Good luck! -Robby -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On

RE: [SQL] "Display of specified number of records."

2001-07-10 Thread Robby Slaughter
You want to just display records WHERE the field is BETWEEN 10 and 50? SELECT * FROM test WHERE testID BETWEEN 10 AND 50; If you want them to be ordered by the testID, just include a ORDER BY testID; See, isn't SQL a friendly language? :-) -Robby Hi, I have got following simple SQL. Selec

Re: [SQL] ERROR: Procedures cannot take more than 16 arguments

2001-07-10 Thread Josh Berkus
Peter, > FUNC_MAX_ARGS in config.h; see the comments there. Darn! I asked this a year ago, and was told by somebody at Hub.org that it couldn't be changed ... -Josh __AGLIO DATABASE SOLUTIONS___ Josh Berkus Complete informat

Re: [SQL] Re: [INTERFACES] distinguishing different database connections

2001-07-10 Thread Roberto Mello
On Tue, Jul 03, 2001 at 11:07:35AM -0500, Manika Dey wrote: > > Hi, > Is postgresql database available for WindowsNT platform. Yes. Download CygWin at http://www.cygwin.com and read the documentation in postgresql.org regarding installation on Windows. -Roberto -- +| htt

Re: [SQL] ERROR: Procedures cannot take more than 16 arguments

2001-07-10 Thread Tom Lane
"Josh Berkus" <[EMAIL PROTECTED]> writes: >> FUNC_MAX_ARGS in config.h; see the comments there. > Darn! I asked this a year ago, and was told by somebody at Hub.org that > it couldn't be changed ... A year or so ago, that was the correct answer. regards, tom lane --

Re: [SQL] SQL question

2001-07-10 Thread Josh Berkus
Deepali, >I have a simple question about nested SQL statements. I > remember > having learnt of another way of writing nested SQL statements, using > Joins I > guess. ... I'm afraid that your question is much to general to be answered. Frankly, I'm not sure what you mean by "

Re: [SQL] Problem in running the postmaster

2001-07-10 Thread Tom Lane
"Raghavendra" <[EMAIL PROTECTED]> writes: > I have installed the latest version 0f PostgreSQL on a Linux system. > Also created a database. But now when I try to execute th Postmaster I will > be getting the following error: > 980606.18:21:07.371 [17703] DEBUG: Data Base System is starting

[SQL] A free ODBC client to use with any database.

2001-07-10 Thread Petarian
Hello, Try WinSQL at http://www.indus-soft.com/winsql. It is absolutely FREE and does not expire. It is only one file and does not come with any bulky DLLs. If you don't like it, simply delete the file from your harddisk. Features: -- * Connect to any database through ODBC * Syntax Highl

Re: [SQL] automatic restore of database

2001-07-10 Thread Grant
www.postgresql.org/docs Go to Admin and look up pg_dump. It has some nice examples. A postgresql backup script is available at http://database.sourceforge.net ---(end of broadcast)--- TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTE

[SQL] "Display of specified number of records."

2001-07-10 Thread rajesh
Hi, I have got following simple SQL. Select TestID from test where testname = ' ' order by testdate. Suppose for argument sake there are 100 records and testID's are 1 to 100. Is it possible to modify this SQL so that it will display records from 10 to 50 and not any other records. Raj

Re: [INTERFACES] Re: [SQL] indexing arrays in pgaccess's query interface is failing

2001-07-10 Thread Constantin Teodorescu
Tom Lane wrote: > > [ redirected to pgsql-interfaces, which seems a more appropriate venue ] > > David Stanaway <[EMAIL PROTECTED]> writes: > > --.. And now the query that I am having problems with. > > > > SELECT itID, itProperties[akID], akName > > FROM items, arraykeys; > > > > In pgaccess, >

[SQL] SQL question

2001-07-10 Thread Deepali Agarwal
hello, I have a simple question about nested SQL statements. I remember having learnt of another way of writing nested SQL statements, using Joins I guess. I'm buildingh an ASP/ADO application or which using nested select becomes too complicated. Could you please throw some light ( pr

[SQL] Re: need oracle ROWNUM equivalent

2001-07-10 Thread --CELKO--
>> I need Oracle ROWNUM equivalent. For doing following operation --- - VIEW Y.XL VIEW Y.XRVIEW Y_XL_XR 1 + 5 = 15 6 10 610 12 20 12

[SQL] automatic restore of database

2001-07-10 Thread Jacky Cheang
Dear sir/mdm, How do I automatic restore a database everyday in the morning? Pls advise, Jacky ---(end of broadcast)--- TIP 4: Don't 'kill -9' the postmaster

[SQL] Re: sql startment problem PLEASE HELP .....

2001-07-10 Thread Stephen Bell
Hi Penny, I hope someone proves me wrong, but I don't think you can modify a constraint like thatI believe you have to drop it and recreate it. Steve penny wrote: > Hi all, > > I am using Oracle8i Enterprise Edition in window 2000 > > my problem as following > > ~ > > S

[SQL] SQL - histogram

2001-07-10 Thread Txugo
Hi, I've a problem as follow: I have a table where one record represent a person, including his height. I'd like to know how many person have more than 150 cm, more than 160 cm and so on. How can I do that using SQL? Example: people > 150 - 1000 > 160 - 850 > 170 - 500 > 1

[SQL] Re: Re: Using Random Sequence as Key

2001-07-10 Thread Ken Corey
First of all, let me apologise for stepping so far back into the archives, but I wanted to get this in the archives in case anyone else wanted to use this. There's a slight addendum here...as written, it's fairly likely that people will get duplicate ID's using this system. A small change get

[SQL] distributed database

2001-07-10 Thread Sharmad Naik
How can i have distributed dbase in PostgreSQL (multiple and incomplete database ..horizontal & vertical frag.).Can anybody give me a link or something related to it. -Thanks Sharmad -- Donot rely on the Operating System which don't have any sources for. -S

[SQL] sql startment problem PLEASE HELP .....

2001-07-10 Thread penny
Hi all, I am using Oracle8i Enterprise Edition in window 2000 my problem as following ~ SQL> create table ttt 2 ( name varchar2(100) 3 , 4 constraint e check (name = lower(name))); Table created. SQL> alter table ttt 2 modify constraint e 3 check (na

[SQL] Help! Failure of pgdump -a

2001-07-10 Thread Josh Berkus
Folks, In an effort to do some general cleanup in my database functions, I dumped the schema (pgdump -s) and the data (pgdump -a) to seperate text files. I editied and restored the schema fine. However, when I attemped to restore the data (via \i filename), it failed selectively; some tables we

[SQL] Updated rowcount

2001-07-10 Thread Jason Alexander
Hello all, I'm attempting to find the property (if it exists) where I can check to see how many rows were affected during an UPDATE. An equivalent would be @@ROWCOUNT in SQL Server, etc... As an example: UPDATE tablefoo SET foo1 = 'spork' WHERE foo2 = 'goomba' IF @@ROWCOUNT = 0 INSERT INTO

[SQL] Problem in running the postmaster

2001-07-10 Thread Raghavendra
hi, I have installed the latest version 0f PostgreSQL on a Linux system. Also created a database. But now when I try to execute th Postmaster I will be getting the following error: 980606.18:21:07.371 [17703] DEBUG: Data Base System is starting up at Sat Jun 6 18:21:07 1998

[SQL] SQL Project

2001-07-10 Thread Dave Goldstein
SQL Programmer needed to write an online course on basic sql. You will be guided through the whole porject, and the benefits are really good. This is a very profitable project, but needs to be started soon. It is not a very long project. Please email me at [EMAIL PROTECTED] if you have any ques

[SQL] can we write to a flat file from Postgresql procedure

2001-07-10 Thread R Vijayanath
Hi, I found your name in the Postgresql web site. It would be great if you can tell me if I can write a procedure that can write the output to the OS(Linux OS) file. Can you assist me on this if there is a way to do it. We are using Postgresql 7.1 running in Linux Redhat 7.1. Thanks in Advanc

[SQL] Re: [INTERFACES] distinguishing different database connections

2001-07-10 Thread Manika Dey
Hi, Is postgresql database available for WindowsNT platform. manika --- From:- | Ms. Manika Dey.|Ph.No:-- Engineer-SC (Comp. Tech.) | IPR -- 02712 - 69276 I.P.R

[SQL] Re: sql startment problem PLEASE HELP .....

2001-07-10 Thread Mark D Powell
Stephen Bell <[EMAIL PROTECTED]> wrote in message news:<[EMAIL PROTECTED]>... > Hi Penny, > > I hope someone proves me wrong, but I don't think you can modify a > constraint like thatI believe you have to drop it and recreate it. > > Steve > > penny wrote: > > > Hi all, > > > > I am using

Re: [SQL] ERROR: Procedures cannot take more than 16 arguments

2001-07-10 Thread Peter Eisentraut
Kristis Makris writes: > ERROR: Procedures cannot take more than 16 arguments > Can this limit be increased by manipulating some variable in the > postgres source code? If so, how would I go about finding which file + > variable I need to alter? FUNC_MAX_ARGS in config.h; see the comments ther

[SQL] ERROR: Procedures cannot take more than 16 arguments

2001-07-10 Thread Kristis Makris
Hello all, Using PostgreSQL 7.1.2 on i686-pc-linux-gnu, compiled by GCC egcs-2.91.66, I attempted to create a plpgsql function that takes 17 arguments and I received the error: ERROR: Procedures cannot take more than 16 arguments Can this limit be increased by manipulating some variable in th

Re: [SQL] Group by date_part

2001-07-10 Thread Roberto Mello
On Tue, Jul 10, 2001 at 08:04:55PM +0100, Graham Vickrage wrote: > > The statement I have only selects the count if there is at least 1 order for > a particular day, which make sense. > > I however need a count of 0 for days that don't have any. Can anyone help? > > SQL: > > SELECT date_part('

Re: [SQL] Problems with PG_DUMP and restore

2001-07-10 Thread Andre Schnabel
Hi, >In an effort to do some general cleanup in my database functions, I >dumped the schema (pgdump -s) and the data (pgdump -a) to seperate text >files. I'm using a similar method for my own project. But I dump the data with the -d or -D option. This ist not as fast as the raw copy but more fle

[SQL] Group by date_part

2001-07-10 Thread Graham Vickrage
Hi, I need to select the amount of orders per day from an order table. The statement I have only selects the count if there is at least 1 order for a particular day, which make sense. I however need a count of 0 for days that don't have any. Can anyone help? SQL: SELECT date_part('day', date)

Re: [SQL] Problems with PG_DUMP and restore

2001-07-10 Thread Josh Berkus
Richard, > > Try having a look at the order the tables get inserted esp. with > regard to > any foreign keys etc. - I'm not sure pgdump is that clever about such > things. Thanks. I did try that; however: 1. Even trying re-loading the tables twice did not work, as it should have with missing f

[SQL] duplicated OIDs ?

2001-07-10 Thread Dado Feigenblatt
I have this test DB (thank's God!) where I was fooling around. I was playing with data from a pg_dump (tables and data with OID's). The generated SQL script doesn't check for the existence of the DB, and doesn't use transactions. So it failed on creating the DB, but copied the dumped data in again

Re: [SQL] Problems with PG_DUMP and restore

2001-07-10 Thread Richard Huxton
From: "Josh Berkus" <[EMAIL PROTECTED]> > Folks, > > In an effort to do some general cleanup in my database functions, I > dumped the schema (pgdump -s) and the data (pgdump -a) to seperate text > files. > > I editied and restored the schema fine. However, when I attemped to > restore the data (v

Re: [SQL] CREATE TYPE function examples

2001-07-10 Thread Tom Lane
Roberto Mello <[EMAIL PROTECTED]> writes: > What would the functions my_procedure_1 and my_procedure_2 look like? src/backend/utils/adt/ is full of examples of datatype I/O procedures. Pick an existing type that does something vaguely like your type (at the very least pick one that uses the same

Re: [SQL] CREATE TYPE function examples

2001-07-10 Thread Roberto Mello
On Tue, Jul 10, 2001 at 06:43:59PM +0200, Peter Eisentraut wrote: > > http://www.ca.postgresql.org/users-lounge/docs/7.1/postgres/xtypes.html Oh. So you have to write a function in C to use CREATE TYPE? > This seems to be outdated regarding the fmgr update, though. (Hint, > hint...)

Re: [SQL] CREATE TYPE function examples

2001-07-10 Thread Peter Eisentraut
Roberto Mello writes: > I'm looking for some examples of how the functions for CREATE TYPE > should be. There are none in the documentation, so I was hoping to find > someone here that could help me. http://www.ca.postgresql.org/users-lounge/docs/7.1/postgres/xtypes.html This seems to be

[SQL] CREATE TYPE function examples

2001-07-10 Thread Roberto Mello
I'm looking for some examples of how the functions for CREATE TYPE should be. There are none in the documentation, so I was hoping to find someone here that could help me. For example, the documentation has this example: CREATE TYPE box (INTERNALLENGTH = 8, INPUT = my_procedur

[SQL] Problems with PG_DUMP and restore

2001-07-10 Thread Josh Berkus
Folks, In an effort to do some general cleanup in my database functions, I dumped the schema (pgdump -s) and the data (pgdump -a) to seperate text files. I editied and restored the schema fine. However, when I attemped to restore the data (via \i filename), it failed selectively; some tables wer

Re: [SQL] select only the first record

2001-07-10 Thread Christof Glaser
On Tuesday, 10. July 2001 15:09, [EMAIL PROTECTED] wrote: > Hello there > > Is it possible to do a query and selecting only the first record in > ad table ? > > e.g. select FIRST * from cars SELECT * FROM cars ORDER BY LIMIT 1; Without ORDER BY, there is no "first" record - any record could be

Re: [SQL] select only the first record

2001-07-10 Thread Jan Wieck
[EMAIL PROTECTED] wrote: > Hello there > > Is it possible to do a query and selecting only the first record in ad > table ? > > e.g. select FIRST * from cars You can either use a CURSOR and FETCH only the first row, or use LIMIT (non-standard). And you might want to explicitly O

[SQL] select only the first record

2001-07-10 Thread juerg . rietmann
Hello there Is it possible to do a query and selecting only the first record in ad table ? e.g. select FIRST * from cars Tx in advance ... jr PFISTER + PARTNER, SYSTEM - ENGINEERING AG Juerg Rietmann Grundstrasse 22a 6343 Rotkreuz Switzerland phone