Criteria order in WHERE clause

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance

From: Craig (Craig_at_discussions.microsoft.com)
Date: 01/24/05


Date: Mon, 24 Jan 2005 12:17:03 -0800

Is there an order in which the criteria of a WHERE clause is executed (first
to last, or last to first) or does the optimizer check to find our on which
to run first?

ex:
  Query1:
    select * from someTable where criteriaA = valueA and criteriaB = valueB
  Query2:
    select * from someTable where criteriaB = valueB and criteriaA = valueA

if we know CriteriaB will execute quicker than CriteriaA, will Query1 run
quicker than Query2?

thanks,
Craig



Relevant Pages

  • Re: New Entourage 2004 leaves junk mail as read
    ... tab that looks like this: ... Execute if all criteria are met ... Entourage Help Page: ...
    (microsoft.public.mac.office.entourage)
  • Re: cancel event
    ... 'Execute your code here ... Wayne Morgan ... MS Access MVP ... if certain criteria was not met the codes will ...
    (microsoft.public.access.formscoding)
  • Using case
    ... are modified and execute various functions according to different criteria. ... Private Sub Worksheet_Change(ByVal Target As Range) ... and if it won't how can I achieve this sort of result (it needs to be based ...
    (microsoft.public.excel.programming)
  • Re: Access Shuts Down after Me.Form.Requery
    ... after the change the record does not meet the criteria. ... Q2 Answer = The code is in the form's class module. ... as they do when there are no records to display ... > Does it make any difference if you execute Me.Requery instead of ...
    (microsoft.public.access.formscoding)
  • SQL questions
    ... When I write in the criteria DELETE BETWEEN 151975 AND 151980, it dosen't want to execute the function because no JobId's appear. ... The sql pane gives me the below: ... Another question is there a limit for querys and if so is the a way to disable it because I have an enormous amount of data transfering. ...
    (microsoft.public.sqlserver.programming)