Re: [SQL] Your question in postgresql.org forum (Diff. between two times as a numeric value in a stored proc)

2004-06-16 Thread Stijn Vanroye
. I took the liberty of CC-ing the postgresql mailinglist so other's having a similar problem can read about this solution too. It's all about the (open-source)-community isn't it :) Kind regards, Stijn Vanroye -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PRO

Re: [SQL] Difference between two times as a numeric value in a stored procedure. [Scanned]

2004-06-04 Thread Stijn Vanroye
> "Stijn Vanroye" <[EMAIL PROTECTED]> writes: > > I can't seem to find a way to substract two time values (or > > timestamp values) and get a numeric/float value. I always get the > > INTERVAL datatype. > > extract(epoch from interval) may help. >

[SQL] Difference between two times as a numeric value in a stored procedure.

2004-06-04 Thread Stijn Vanroye
t this problem? Is there a function I can use? I don't know if it helps but I'm going to use the functions like this: SELECT workhour_id, employee_id, task_id, whdate, begintime, endtime, getdayhours(begintime,endtime), getnighthours(begintime,endtime) FROM

Re: [SQL] a wierd query

2004-05-18 Thread Stijn Vanroye
ple who replied (and started the thread) are in place here. Kind regards, Stijn Vanroye > -Original Message- > From: Stephan Szabo [mailto:[EMAIL PROTECTED] > Sent: maandag 17 mei 2004 17:01 > To: Stijn Vanroye > Cc: [EMAIL PROTECTED]; Edmund Bacon > Subject: Re: [SQL]

Re: [SQL] a wierd query

2004-05-17 Thread Stijn Vanroye
First of all, I don't select distinct on 1 value, but on 2. Meaning I want each unique combination of task_id (or employee_id in this example) and date. That way both fields still have meaning. the workhour_id field is indeed redundant, but was still there from some pevious testing work. (It is

Re: [SQL] a wierd query

2004-05-17 Thread Stijn Vanroye
is question has risen. Kind regards, Stijn Vanroye > -Original Message- > From: Edmund Bacon [mailto:[EMAIL PROTECTED] > Sent: donderdag 13 mei 2004 17:28 > To: sad > Cc: [EMAIL PROTECTED] > Subject: Re: [SQL] a wierd query > > > sad wrote: > > select

Re: [SQL] a wierd query

2004-05-17 Thread Stijn Vanroye
: 2961 rows. So I got 3 different result sets for 3 different ways to run the query. Even in this last case the UNION doesn't seem to only return unique values, and I will still need the top-level select. > -Original Message- > From: Stijn Vanroye > Sent: maandag 17 mei

Re: [SQL] select distinct and order by

2004-04-28 Thread Stijn Vanroye
he help, Stijn Vanroye -Original Message- From: Viorel Dragomir [mailto:[EMAIL PROTECTED] Sent: woensdag 28 april 2004 11:54 To: Stijn Vanroye; [EMAIL PROTECTED] Subject: Re: [SQL] select distinct and order by I don't know if this will work, but why not try it ? :) select distinc

[SQL] select distinct and order by

2004-04-28 Thread Stijn Vanroye
could happen that two people have the same name, so a distinct on fullname could make problems. The facts: - PostgreSQL 7.3.2 running on RH 9 - pgODBC 7.3.0200 - Borland Delphi 7 enterprise Regards, Stijn Vanroye -=[Today I got more responsabilities from my boss, as from now I'm respo

Re: [SQL] Order by YYYY MM DD in reverse chrono order trouble

2004-04-23 Thread Stijn Vanroye
Indeed, it seems that I get the same result for a similar query. I'm running version 7.3.4 on a rh 9 server. Also: is the function date_part a function you wrote yourself? I get an error stating that the function date_part("Unknown",date) is not recognized. It maybe not a solution to the actual

Re: [SQL] Order by YYYY MM DD in reverse chrono order trouble

2004-04-22 Thread Stijn Vanroye
hat _are_ distinct, > but are on the same day. > > For example: > > 2004 04 02 11:22:33.034 > 2004 04 02 22:33:44.055 > > Thanks, > Otis > > > --- Stijn Vanroye <[EMAIL PROTECTED]> wrote: > > > Hello, > > > > > > I'd love

Re: [SQL] Order by YYYY MM DD in reverse chrono order trouble

2004-04-21 Thread Stijn Vanroye
DESC, date_part('day', uu.add_date) DESC; That way you are sure each of the fields is sorted DESC. if you don't specify a direction in your order by clause postgres will take ASC as the default. I think that he does "ASC,ASC,DESC" instead. I'm not sure if he applies

Re: [SQL] three-way join - solved

2004-04-20 Thread Stijn Vanroye
ft join consumables on (bmain.cost_cs_id=consumables.cs_id) left join cons_locations on (bmain.cost_cl_id=cons_locations.cl_id) P.S. Don't ask about performance of the query, I haven't delved that deep into it :-) Regards and good luck, Stijn Vanroye ---(end of broadcast)--- TIP 7: don't forget to increase your free space map settings

Re: [SQL] three-way join

2004-04-19 Thread Stijn Vanroye
-to-date? (eg. CONS_STOCK (cs_id, cl_id, hand_qty, order_qty) PK(cs_id, cl_id) ) that way you simply change the quantity fields for each combination of location-consumable according to the situation (and sound the alarm if the reach a certain level?). If anyone thinks I'm wrong, please c