Re: SQL statement

From: David Pattinson <david_at_addease.com.au>
Date: 1999/05/11
Message-ID: <3737A152.4513ABF3_at_addease.com.au>#1/1


Do you have an index on Street_Code? If not then the query will take longer. Incidentally, you probably should use "a.Street_Code" since that's how you've referred to the column elsewhere.

HTH, David.

hpcheong_at_ncs.com.sg wrote:

> hi,
>
> if i do the following statement, the result is instant.
>
> select a.UIN, a.Name, a.Street_Code, a.Block, a.Storey_No, a.Main_Hse,
> a.Sub_Hse, a.Sex_Code, a.DOB, a.Race_Code, a.Country_of_Birth_Code,
> a.Bkgrd_Lang_Stream_Code, a.Edn_Code, a.Religion_Code from tb_EASY_RMF a
> where citizenship_code = '0' and to_number(rpad(dob,8,'0')) <=
> to_number(to_char(to_date('31/05/1978','DD/MM/YYYY'),'YYYYMMDD')) and
> Date_New_IC_Issued <= to_date('31/05/1999','DD/MM/YYYY');
>
> but is i add a order by at the end, it seems like hanging there, why? pls
> help cos, it's urgent. thanks..
>
> select a.UIN, a.Name, a.Street_Code, a.Block, a.Storey_No, a.Main_Hse,
> a.Sub_Hse, a.Sex_Code, a.DOB, a.Race_Code, a.Country_of_Birth_Code,
> a.Bkgrd_Lang_Stream_Code, a.Edn_Code, a.Religion_Code from tb_EASY_RMF a
> where citizenship_code = '0' and to_number(rpad(dob,8,'0')) <=
> to_number(to_char(to_date('31/05/1978','DD/MM/YYYY'),'YYYYMMDD')) and
> Date_New_IC_Issued <= to_date('31/05/1999','DD/MM/YYYY') order by
> Street_Code, Block, Storey_No, Main_hse, Sub_hse;
>
> --
> evelyn.
>
> --== Sent via Deja.com http://www.deja.com/ ==--
> ---Share what you know. Learn what you don't.---
Received on Tue May 11 1999 - 00:00:00 CEST

Original text of this message