Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Database > SQL Language
|
SQL Language SQL Language discussions not specific to a particular RDBMS program or vendor.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the SQL Language section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old October 22nd, 2003, 12:48 AM
Authorized User
 
Join Date: Oct 2003
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to SubodhKumar Send a message via Yahoo to SubodhKumar
Default Query optimization

Hi All,
Can any one send me some links of web site that will help me to optimize my sql queries.

E.g.
we have table data,having many fields including a field sup_date.
i want to retriev all data between 06/30/2001 & 07/30/2001
for this which query will excute faster.
  1. select * from data where sup_date>='06/30/2001' and sup_date<='07/30/2001'
   2. select * from data where sub_date between '06/30/2001' and '07/30/2001'

Plese help;
Thanx in Advance.

Enjoy!
Subodh Kumar
Phoneytunes.com
__________________
<font size=\"2\"><font color=\"blue\"><b>Enjoy!
Subodh Kumar
Phoneytunes.com
</b></font id=\"blue\"></font id=\"size2\">
 
Old October 22nd, 2003, 06:35 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 839
Thanks: 0
Thanked 1 Time in 1 Post
Default

If you look at the query execution plan for those two queries in SQL Server, you'll see they are absolutely identical.

Make sure you have an index on the 'sup_date' column (maybe even the clusteered index) and that will be about as fast as it can get.

Sorry, I can't help you with any links.

Jeff Mason
Custom Apps, Inc.
www.custom-apps.com





Similar Threads
Thread Thread Starter Forum Replies Last Post
Python code optimization icopec Python 2 December 13th, 2011 05:13 AM
Search Engine Optimization radiohalo5 ASP.NET 1.x and 2.0 Application Design 4 November 27th, 2010 09:44 PM
SQL Optimization - Query takes a long time jlrolin SQL Language 2 March 20th, 2007 08:01 AM
Optimization akkad C# 5 November 1st, 2006 05:27 AM
Pass-Through Query Optimization redrobot5050 Access VBA 3 June 18th, 2004 01:25 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.