Select 'Sunday' in month ??
Select 'Sunday' in month ??
От:
Tubagus Nizomi <nizomi@dnet.net.id>
Дата:
i want to select date in january where day='Sunday' any idea ?? please help me Nizomi
Re: Select 'Sunday' in month ??
От:
"tjk@tksoft.com" <tjk@tksoft.com>
Дата:
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
>
Re: Select 'Sunday' in month ??
От:
Karel Zak <zakkr@zf.jcu.cz>
Дата:
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