Re: Simple Oracle Questions!

From: Jennifer R. Amon <bamon_at_ocvaxc.cc.oberlin.edu>
Date: Fri, 03 Jun 1994 15:36:59 -0500
Message-ID: <bamon-030694153659_at_amon.cc.oberlin.edu>


In article <2snmct$cla_at_ucunix.san.uc.edu>, pateljb_at_ucunix.san.uc.edu (Jay Patel) wrote:

> 1) How'd I subtract Time??
>
> I tried :
>
> to_char(f1, 'HH24:MM:SS') - to_char(f2, 'HH24:MM:SS')
>
> but, it doesn't work.

I know at least one way, assuming that f1 is a DATE field:

Convert the pieces of the time to seconds, e.g.

((to_number(to_char(f1,'HH24'))*3600)+
 (to_number(to_char(f1,'MI'))*60)+
 (to_number(to_char(f1,'SS'))))  - (same thing for f2)

Then convert the result back to a time.

> 2) Can I interst a character(i.e., *) in the output of a select??
>
> select Name, Zip from Tab1;
>
> I want the output to be
>
> Name1 * Zip1
> Name2 * Zip2
> Name3 * Zip3

select name || ' * ' || zip from Tab1;


Jennifer R. Amon            PHONE: (216) 775-6987
Houck Computing Center        FAX: (216) 775-8573
Oberlin College
Oberlin, OH 44074        INTERNET: bamon_at_ocvaxc.cc.oberlin.edu
_____________________________________________________________________
Received on Fri Jun 03 1994 - 22:36:59 CEST

Original text of this message