[SQL] car mileage summation / sledgehammer method

2000-08-16 Thread Oliver Seidel
OK, this is quite brutal and is going to be very expensive, but I think it does what you want. The trick lies in the idea of joining a table with itself. Thus, I first define a virtual copy of the table (in my case "dup") and then produce a query that joins the table to this copy. Enjoy. Oliv

[SQL] Help on some SQL command...

2000-08-16 Thread Ang Sei Heng
Hello to all the SQL gurus... I have this little table: test1 ( id char(8) primary key, name char(20), create_date timestamp ); Now, the create_date need to be updated to date and time whenever id is being inserted or updated. Is there a way in SQL that I can do this au

[SQL] Re: car mileage summation / sledgehammer method

2000-08-16 Thread Francisco Hernandez
great! Thanks for taking the time to demonstrate this! - Original Message - From: "Oliver Seidel" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]>; "Francisco Hernandez" <[EMAIL PROTECTED]>; "Volker Paul" <[EMAIL PROTECTED]> Sent: Wednesday, August 16, 2000 2:26 PM Subject: car mileage summati

[SQL] Trigger vs rule

2000-08-16 Thread Richard E Nairn
I am in the process of creating a database to keep of my car's fuel costs and mileage. I am having a little bit of trouble deciding if I need to use a rule to do what I want or a trigger. I have created a SQL function that will update the mileage field, but when I try and create a trigger for it,

[SQL] Many-to-one subquery

2000-08-16 Thread Martin Christensen
I have a problem that I have not been able to solve efficiently, and I'm confident that it can be done in a single query. I have a mailing list archive that I want to do some statistics on. It would tremendously ease my work if I could extract such statistics for each individual poster in one go.

Re: [SQL] variables in SQL??

2000-08-16 Thread DalTech - CTE
> what im trying to do is have a Sum of a colum.. as it goes forwards I don't think this is what you want, but I suppose it might help Table= simple +--+--+- --+ | Field | Type

Re: [SQL] variables in SQL??

2000-08-16 Thread Volker Paul
> what im trying to do is have a Sum of a colum.. as it goes forwards with the > cursor.. > like so: > > Price|Sum > 5|5 > 4|9 > 10|19 > 2|21 > 7|28 I think what you mean is called running sum, I had the same problem before, and I found no other solution than creating a column for it, and calcul

Re: [SQL] lo_export and files permissions

2000-08-16 Thread Mike Baroukh
Hi, > I was using sql lo_export function before upgraded to > 7.0 (which doesn't allow non-admin to call it). So if > possible, you can use the client function lo_export to > extract the blob. I know it's simple in Perl DBI but > not sure about java. I actually use lo_export with java. But th

Re: [SQL] lo_export and files permissions

2000-08-16 Thread Guo Bin
Hi, I was using sql lo_export function before upgraded to 7.0 (which doesn't allow non-admin to call it). So if possible, you can use the client function lo_export to extract the blob. I know it's simple in Perl DBI but not sure about java. Another work-around might be to lo_export the file to

Re: [SQL] returning a recordset with pl/pgsql

2000-08-16 Thread Kovacs Zoltan Sandor
> Is it possible to return recordsets using pl/pgsql? > If so, how do I declare the return type in the declaration? AFAIK you can't. I suggest you using temporary tables instead. Regards, Zoltan

[SQL] lo_export and files permissions

2000-08-16 Thread mike . baroukh
De: Mike Baroukh <[EMAIL PROTECTED]> À: <[EMAIL PROTECTED]> Objet: lo_export and files permissions Date : lundi 14 août 2000 10:44 Hi everybody. Who can help me with a lo_export() problem ? : I'm using lo_export function in sql statement with pgsql 6.5 on Linux RH 6.2. Data are exported fine. M

[SQL] variables in SQL??

2000-08-16 Thread Francisco Hernandez
anyone know if SQL has variables? what im trying to do is have a Sum of a colum.. as it goes forwards with the cursor.. like so: Price|Sum 5|5 4|9 10|19 2|21 7|28 i can do it in the accessing language.. like PHP, Python, Perl etc.. but i wanted to know if the actuall DB could do it? any ideas?