Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: SQL statement

Re: SQL statement

From: David Pattinson <david_at_addease.com.au>
Date: Tue, 11 May 1999 13:17:39 +1000
Message-ID: <3737A152.4513ABF3@addease.com.au>


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 Mon May 10 1999 - 22:17:39 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US