pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Select 'Sunday' in month ??
3+ messages / 3 participants
[nested] [flat]

* Select 'Sunday' in month ??
@ 2001-01-18 01:28 Tubagus Nizomi <nizomi@dnet.net.id>
  2001-01-18 01:40 ` Re: Select 'Sunday' in month ?? tjk@tksoft.com <tjk@tksoft.com>
  0 siblings, 1 reply; 3+ messages in thread

From: Tubagus Nizomi @ 2001-01-18 01:28 UTC (permalink / raw)
  To: pgsql-sql

i want to select date in january where day='Sunday'

any idea ??

please help me

Nizomi



^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: Select 'Sunday' in month ??
  2001-01-18 01:28 Select 'Sunday' in month ?? Tubagus Nizomi <nizomi@dnet.net.id>
@ 2001-01-18 01:40 ` tjk@tksoft.com <tjk@tksoft.com>
  2001-01-18 23:04   ` Re: Select 'Sunday' in month ?? Karel Zak <zakkr@zf.jcu.cz>
  0 siblings, 1 reply; 3+ messages in thread

From: tjk@tksoft.com @ 2001-01-18 01:40 UTC (permalink / raw)
  To: nizomi@dnet.net.id; +Cc: pgsql-sql

E.g.

create table mytable (created datetime);
insert into mytable values ('01-01-2001');
...
insert into mytable values ('01-31-2001');

select created from mytable where date_part('dow', created) = 7 and date_part('month', created) = 1;


Troy

> 
> i want to select date in january where day='Sunday'
> 
> any idea ??
> 
> please help me
> 
> Nizomi
> 




^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: Select 'Sunday' in month ??
  2001-01-18 01:28 Select 'Sunday' in month ?? Tubagus Nizomi <nizomi@dnet.net.id>
  2001-01-18 01:40 ` Re: Select 'Sunday' in month ?? tjk@tksoft.com <tjk@tksoft.com>
@ 2001-01-18 23:04   ` Karel Zak <zakkr@zf.jcu.cz>
  0 siblings, 0 replies; 3+ messages in thread

From: Karel Zak @ 2001-01-18 23:04 UTC (permalink / raw)
  To: tjk@tksoft.com <tjk@tksoft.com>; +Cc: Tubagus Nizomi <nizomi@dnet.net.id>; pgsql-sql


On Wed, 17 Jan 2001, tjk@tksoft.com wrote:

> E.g.
> 
> create table mytable (created datetime);
> insert into mytable values ('01-01-2001');
> ...
> insert into mytable values ('01-31-2001');
> 
> select created from mytable where date_part('dow', created) = 7 and date_part('month', created) = 1;
> 

 This will faster (one function call instead two):

 ..... where to_char(created, 'D/MM') = '7/01';

				Karel




^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2001-01-18 23:04 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2001-01-18 01:28 Select 'Sunday' in month ?? Tubagus Nizomi <nizomi@dnet.net.id>
2001-01-18 01:40 ` tjk@tksoft.com <tjk@tksoft.com>
2001-01-18 23:04   ` Karel Zak <zakkr@zf.jcu.cz>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox