Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Mailing Lists -> Oracle-L -> RE: tuning query with concat string.
Why would you want to re-write it?
This concatenation on the right side of
ws_id = 'S'||userenv('SESSIONID')
doesn't prevent from using index on "ws_id" (if there is one, and that's your concern).
Of cource, it'd be different story, if it would be the other way around, i.e.:
Ws_id || 'S' = userenv('SESSIONID')
Igor
-----Original Message-----
From: oracle-l-bounce_at_freelists.org
[mailto:oracle-l-bounce_at_freelists.org] On Behalf Of The Human Fly
Sent: Tuesday, March 21, 2006 10:37 AM
To: Wolfgang Breitling
Cc: oracle-l
Subject: Re: tuning query with concat string.
I think my question was littble confused.
Okay, following is the query that I wanted to write,
select max(start_time) from fm_audit_form where ws_id = 'S'||userenv('SESSIONID')
Is there any way that I can rewrite this query?
Long time ago, I have read that we can rewrite queries that has concat in the where clause values.
On 3/21/06, Wolfgang Breitling <breitliw_at_centrexcc.com> wrote:
> SELECT ...... FROM where COLUMN = 'SVALUE2';
>
> :-)
>
> Quoting The Human Fly <sjaffarhussain_at_gmail.com>:
>
> > How can I rewrite the query which uses concatination in the where
> > clause? For an example,
> >
> > SELECT ...... FROM where COLUMN = 'S'||'VALUE2';
> >
> --
> regards
>
> Wolfgang Breitling
> Oracle 7,8,8i,9i OCP DBA
> Centrex Consulting Corporation
> www.centrexcc.com
>
>
-- Best Regards, Syed Jaffar Hussain 8i,9i & 10g, OCP DBA Banque Saudi Fransi, Saudi Arabia http://jaffardba.blogspot.com/ ------------------------------------------------------------------------ ---------- "Winners don't do different things. They do things differently." -- http://www.freelists.org/webpage/oracle-l -- http://www.freelists.org/webpage/oracle-lReceived on Tue Mar 21 2006 - 10:02:40 CST
![]() |
![]() |