Re: SQL statement problem

From: Eun-jeong Jeon <zeni_at_hananet.net>
Date: Thu, 30 Aug 2001 01:10:46 +0900
Message-ID: <9ZHIIQKMBHA.351_at_news2.sys.netsgo.com>


SQL> create table test(
  2 department varchar2(20),
  3 depdate date);

Table created.
SQL> insert into test
  2 values('admin', '11-jun-90');

1 row created.

SQL> insert into test
  2 values('purchasing', '06-aug-97'); <--- means 2097year.

1 row created.

SQL> insert into test
  2 values('development', '12-sep-1997');

1 row created.

SQL> select * from test;

DEPARTMENT DEPDATE

-------------------- ---------
admin                11-JUN-90
purchasing           06-AUG-97
development          12-SEP-97

I've just made sample table.
If you want department started in 1997 or 2097, you can use LIKE operator.

SQL> select * from test
  2 where depdate like '%97';

DEPARTMENT DEPDATE

-------------------- ---------
purchasing                    06-AUG-97
development                 12-SEP-97

Be happy all the time!!
from zeni~~~

"Calvin" <calvin_at_isidasia.com.hk> wrote in message news:9mi1kv$qbd$1_at_news.hk.linkage.net...
> Dear all,
>
> I am a student but have some problem about the assignment !
> I hope someone can ans me !!!
>
> I have the date field in table,
> eg. department depdate
> admin l1-JUN-90
> purchasing 06-AUG-97
> development 12-Sept-97
>
> now I want select the department start in 1997.
> how to write SQL statement in specify the Year is ??
>
> Thanks
> Calvin
>
>
>
Received on Wed Aug 29 2001 - 18:10:46 CEST

Original text of this message