[Info-ingres] Selecting rows based on time range

Allan Biggs Allan.Biggs at GBR.dupont.com
Thu Mar 10 11:42:05 UTC 2016


  1> select on_date  from my_table 
     where date_part('hours',on_date) = '11'
     or   date_part('hours',on_date) = '10'



+-------------------------+
|on_date                  |
+-------------------------+
|23-jan-2002 10:46:45     |
|18-oct-1995 11:43:18     |
|26-sep-2007 11:53:46     |
|10-oct-2007 10:07:28     |
|25-oct-2007 10:59:32     |
|08-may-2008 11:43:46     |
|05-aug-2008 10:06:57     |
|30-jun-1994 10:06:51     |
|04-apr-2007 10:57:00     |
|29-may-2007 10:31:16     |
|29-may-2007 11:10:09     |
|26-sep-2007 11:53:27     |
|25-oct-2007 10:59:22     |



From:   Allan Biggs <Allan.Biggs at GBR.dupont.com>
To:     abc at google.com
Cc:     info-ingres at lists.planetingres.org, 
info-ingres-bounces at lists.planetingres.org
Date:   10/03/2016 11:37
Subject:        Re: [Info-ingres] Selecting rows based on time range
Sent by:        info-ingres-bounces at lists.planetingres.org



maybe something like 
select  date_part('hours',on_date) from table 

do you know 
http://www.r20.nl/TheSQLGuidetoIngres-AppendixB.pdf 




From:        "abc at google.com" <abc at google.com> 
To:        info-ingres at lists.planetingres.org 
Date:        10/03/2016 11:10 
Subject:        [Info-ingres] Selecting rows based on time range 
Sent by:        info-ingres-bounces at lists.planetingres.org 



Hi,

I want to find all rows in my database that were updated between 10:00 
and 11:00   (regardless of day).  I have a column called update_date 
that holds the date and time of the row's last update.

I'm trying something like this:

select * from table
where
update_date-date_trunc('day',update_date)  between  '10:00:00' and 
'11:00:00'

But can't quite get it to work.   Any suggestions?

Thanks.

_______________________________________________
Info-ingres mailing list
Info-ingres at lists.planetingres.org
http://lists.planetingres.org/mailman/listinfo/info-ingres


This communication is for use by the intended recipient and contains
information that may be Privileged, confidential or copyrighted under
applicable law. If you are not the intended recipient, you are hereby
formally notified that any use, copying or distribution of this e-mail,
in whole or in part, is strictly prohibited. Please notify the sender by
return e-mail and delete this e-mail from your system. Unless explicitly
and conspicuously designated as "E-Contract Intended", this e-mail does
not constitute a contract offer, a contract amendment, or an acceptance
of a contract offer. This e-mail does not constitute a consent to the
use of sender's contact information for direct marketing purposes or for
transfers of data to third parties.
Francais Deutsch Italiano  Espanol  Portugues  Japanese  Chinese  Korean
          http://www.DuPont.com/corp/email_disclaimer.html
_______________________________________________
Info-ingres mailing list
Info-ingres at lists.planetingres.org
http://lists.planetingres.org/mailman/listinfo/info-ingres


This communication is for use by the intended recipient and contains
information that may be Privileged, confidential or copyrighted under
applicable law. If you are not the intended recipient, you are hereby
formally notified that any use, copying or distribution of this e-mail,
in whole or in part, is strictly prohibited. Please notify the sender by
return e-mail and delete this e-mail from your system. Unless explicitly
and conspicuously designated as "E-Contract Intended", this e-mail does
not constitute a contract offer, a contract amendment, or an acceptance
of a contract offer. This e-mail does not constitute a consent to the
use of sender's contact information for direct marketing purposes or for
transfers of data to third parties.

Francais Deutsch Italiano  Espanol  Portugues  Japanese  Chinese  Korean

          http://www.DuPont.com/corp/email_disclaimer.html
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.planetingres.org/pipermail/info-ingres/attachments/20160310/9d2ffcdf/attachment.html>


More information about the Info-ingres mailing list