473,395 Members | 1,678 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

trunc(hiredate) = trunc(sysdate) or trunc(hiredate) = to_date('2012/02/12','yyyy/mm/d

hi all,

I have SELECT query, with WHERE condition.

ex:- select * from emp e
where trunc(hiredate) = trunc(sysdate);

ex-2:-select * from emp e
where trunc(hiredate) = to_date('2012/02/12','yyyy/mm/dd');

Is there any difference between ex and ex-2 in performance wise. Please help me.

Thanks to ALL.
Mar 1 '14 #1
2 2869
for testing purpose i have changed ex to ex1, to get data.
But i am doubting about changing the SQL. because they are going to deploying code changes into PROD environment. If it takes more time? then wat will happen?

Please help.
Mar 1 '14 #2
Rabbit
12,516 Expert Mod 8TB
There will be little to no different in performance of the two. The right side only needs to be evaluated once so that plays a very small role in the performance.

If you are going to have a problem with performance, that might come from the left side because has to be run on every row. But it's a very quick function so it may not matter at all.

I say go with whichever one you want but if you do run into performance issues, you can try a range instead so you don't have to run any calculations on hiredate.
Mar 1 '14 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Alistair | last post by:
it's the idiot with his query strings again...."yippeee" I hear aaron shout this time the problem is with a date format query I have a query string thus strSQL = "SELECT * FROM users where...
3
by: Ted Johnson | last post by:
The following query works fine against SQL Server 2000 here in the US: SELECT * from TNEWSARTICLES where CreatedOn < '2003-04-25 14:22' But in the UK, it returns this error: 80040e07: The...
6
by: dyw55a | last post by:
How to implement mm/dd/yyyy format for textbox? I have text box with format mm/dd/yyyy. Now I want the cursor i generated whenever user highlight this textbox and whatever user inpu replace one...
2
by: Ange T | last post by:
Hi there, I've read stacks of articles on this subject in this newsgroup, so forgive me that this is just another one. I've tried almost all the suggestions offered, and am still having no luck....
13
by: Roy | last post by:
Hi all, I'm creating a project that should always use this date format when displays the dates or create dates. The back end database is a SQL Server and I like to know what is the logical way...
12
by: Assimalyst | last post by:
Hi, I have a working script that converts a dd/mm/yyyy text box date entry to yyyy/mm/dd and compares it to the current date, giving an error through an asp.net custom validator, it is as...
17
by: Petyr David | last post by:
Just looking for the simplest. right now my perl script returns an error messge to the user if the date string is invalid. would like to do this before accessing the server. TX
12
by: Vincent Delporte | last post by:
Hello My site is hosted on a server in the US, hence set up to use the mm/dd/yyyy date format instead of the European dd/mm/yyyy. Also, MySQL stores dates as yyyy-mm-dd, so I need to convert...
3
by: Eric Layman | last post by:
Hi, In general, how do u configure/script to allow .net to accept date in dd/mm/yyyy format? By default, my sys only allows mm/dd/yyyy format. Eg: Take alook at
4
by: Ashraf Ansari | last post by:
Hi, How Can I convert MM/dd/yyyy format into dd/MM/yyyy and the date which is converted into dd/MM/yyyy should be in DateTime format. I do not want to store it as a string. Please help ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.