[SQL] one table being used for two purposes with foreign key for each?

2005-01-02 Thread Miles Keaton
What if, like Amazon, a customer can have more than one address on file? Then you make "addresses" a separate table with one-to-many relationship. So then you're making affiliates (or clients, or distributors) and you realize it would be nice to re-use the fields you already have there in the "ad

Re: [SQL] Formatting an Interval

2005-01-02 Thread Karel Zak
On Fri, 2004-12-31 at 12:41 -0700, Michael Fuhr wrote: > On Fri, Dec 31, 2004 at 11:37:32AM -0500, Jamison Roberts wrote: > > > All of the functions that i've looked at seem to only extract parts > > from Intervals. What I need to do is to format the interval. For > > instance, I have a Interval

Re: [SQL] Formatting an Interval

2005-01-02 Thread Michael Fuhr
On Sun, Jan 02, 2005 at 05:19:23PM +0100, Karel Zak wrote: > On Fri, 2004-12-31 at 12:41 -0700, Michael Fuhr wrote: > > > You could write a function to format the interval. For example, > > with PL/pgSQL you could use EXTRACT(epoch FROM interval_value) to > > convert the interval to a number of se

Re: [SQL] Formatting an Interval

2005-01-02 Thread Kretschmer Andreas
am Sun, dem 02.01.2005, um 17:19:23 +0100 mailte Karel Zak folgendes: > > You could write a function to format the interval. For example, > > with PL/pgSQL you could use EXTRACT(epoch FROM interval_value) to > > convert the interval to a number of seconds; convert that to hours, > > minutes, and

Re: [SQL] Formatting an Interval

2005-01-02 Thread Pierre-Frédéric Caillaud
Note that there will be a loss of precision as an interval of 1 month, for instance, does not mean any specific number of days, as : 1 february + 1 month = 1 march (1 month = 28 or 29 days) 1 december + 1 month = 1 january(1 month = 31 days) Same for years etc. -