Jump to content

sql helf ravali ravali


nenu_devudni

Recommended Posts

In my query i am checking if my date field is equal to sysdate .. and using trunc on both ends .. and my date field has a index on it .. and by using trunc .. aa index dobutundi .. and its taking lot of time to execute .. how do i keep my index from not blowing using trunc ... seppandi vay bemmi.kiss.gif

Link to comment
Share on other sites

indexed-date field ni inko additional column/field ga pull/populate cheyi... aa field ki edoka alias peru ivu.. 

do operations on that alias field

in short: you are creating a substitution field..without messing wit indexing

Link to comment
Share on other sites

1 minute ago, SwamyRaRa said:

Disable index and truncate table 

then insert after insert create index 

adi production table thatha ..ala cheste bagodu emo kada @~`

Link to comment
Share on other sites

16 minutes ago, 150bryant said:

indexed-date field ni inko additional column/field ga pull/populate cheyi... aa field ki edoka alias peru ivu.. 

do operations on that alias field

in short: you are creating a substitution field..without messing wit indexing

koncham confeesing ga undi vuncle ...   bemmi.adi.gif

Link to comment
Share on other sites

23 minutes ago, 150bryant said:

indexed-date field ni inko additional column/field ga pull/populate cheyi... aa field ki edoka alias peru ivu.. 

do operations on that alias field

in short: you are creating a substitution field..without messing wit indexing

select trunc(my_date_field) as req_date,
(select count(*) from tablename
where blah_blah = 'O'
and bluh_bluh= 'RMTE'
and bleh_bleh = 'C11'
and req_date = trunc(sysdate) 
 ) from tablename b
 

did u mean something like this ?

Link to comment
Share on other sites

8 minutes ago, Tesla said:

 

select * from tab1 where load_dt > trunc(sysdate)

 

or

 

select * from tab1 where load_dt between trunc(sysdate) and trun(sysdate)+1

tanks tesla vuncle .. this worked bemmi.kiss.gif

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...