Article View: chile.comp.programacion
Article #3023Re: consulta sql
From: Manuel Villarroel
Date: Sat, 11 Jun 2005 02:05
Date: Sat, 11 Jun 2005 02:05
34 lines
2172 bytes
2172 bytes
es postgresql. "Jos? Miguel Santib??ez" <jms@nospam.nivel5.cl> wrote: > En el cap?tulo anterior (news:d8dd1c$ftv$1@helcaraxe.dcc.uchile.cl), Manuel > Villarroel <mavillarNOALSPAM@decece.uchile.cl> dijo: > > Como puedo preguntar si una fecha(un campo tipo timestamp) esta > > entre un rango de horas en un dia? Por ejeplo, > > yo quiero todas las fechas tales que la hora sea menor que > > las 12:30 y mayor que las 14:00. > > Si tengo fecha1 = '2005-06-01 11:30' > > fecha2 = '2005-06-01 13:00' > > fecha3 = '2005-06-01 14:15' > > > > quiero que en la respuesta aparezca solo fecha1 y fecha3 > > De antemano gracias > > > > > bajo que SQL? > Siempre me queda la duda respecto de las funciones est?ndares de SQL, pero > debiera existir la funci?n TIME (MySQL) o similar, que trae solo la parte > de la hora de un campo fecha... > As?, podr?as hacer un select "where TIME(fecha) < '12:30:00' or TIME(fecha) > > '14:00:00'" > -- > Jose M. Santiba?ez A. > <jms@nivel5.cl> > <http://caos.cl/jms>
Technical Details
Message-ID:
<d8dgt3$hnd$1@helcaraxe.dcc.uchile.cl>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news.glorb.com!nntp-server.pubsub.com!news1.nivel5.cl!news.cec.uchile.cl!helcaraxe.dcc.uchile.cl!not-for-mailReferences:
<d8dd1c$ftv$1@helcaraxe.dcc.uchile.cl> <Xns9671D6AB8F28Bjmsnews@200.27.221.71>Show Full Headers
Complete Article Headers
X-Google-Thread: 1593cb,847abb2bff51d953
X-Google-Attributes: gid1593cb,public
X-Google-Language: SPANISH,ASCII-7-bit
Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news.glorb.com!nntp-server.pubsub.com!news1.nivel5.cl!news.cec.uchile.cl!helcaraxe.dcc.uchile.cl!not-for-mail
From: Manuel Villarroel <mavillarNOALSPAM@decece.uchile.cl>
Newsgroups: chile.comp.programacion
Subject: Re: consulta sql
Date: Sat, 11 Jun 2005 02:05:23 +0000 (UTC)
Organization: DCC - Universidad de Chile
Lines: 34
Sender: Manuel Alejandro Villarroel Romero <mavillar@anakena.dcc.uchile.cl>
Message-ID: <d8dgt3$hnd$1@helcaraxe.dcc.uchile.cl>
References: <d8dd1c$ftv$1@helcaraxe.dcc.uchile.cl> <Xns9671D6AB8F28Bjmsnews@200.27.221.71>
NNTP-Posting-Host: anakena.dcc.uchile.cl
X-Trace: helcaraxe.dcc.uchile.cl 1118455523 18157 192.80.24.6 (11 Jun 2005 02:05:23 GMT)
X-Complaints-To: newsmaster@dcc.uchile.cl
NNTP-Posting-Date: Sat, 11 Jun 2005 02:05:23 +0000 (UTC)
User-Agent: tin/1.6.2-20030910 ("Pabbay") (UNIX) (Linux/2.6.10-gentoo-r6 (i686))