I'm running into an issue with a select query; it appears the
CONVERT operator is performed before any other condition in the
WHERE clause.
Consider the data below:
Now some queries,
This one works, note only 6 rows are returned:
SELECT
Hi Wal,
I'm not sure it's a case of one being executed first, because I assume the
where clause has to be executed in its entirety before the engine decides
if it matches or not. You are thinking like the operator in c# which
only executes the second half of the comparison if the first half
Wallace Turner wrote:
I'm running into an issue with a select query; it appears the CONVERT
operator is performed before any other condition in the WHERE clause.
Consider the data below:
Now some queries,
This one works, note only 6 rows are returned:
|SELECT Value,CONVERT(DATETIME,
Hi
SQL always executes right to left, all parts of your query are executed but
the filter is only applied on your results. However, the sqlserver
optimiser can and will rearrange your query for you so even checking to see
if it is a date first ( to the right ) is not guaranteed to work. So you
Davy Jones wrote:
Hi
SQL always executes right to left
Are you talking about boolean evauluation? If so... False. (At least for
2008 R2 which I have in front of me)
--
Les Hughes
l...@datarev.com.au
As far as I am aware, and coming from a time when we didn't have
optimisers. All parts are evaluated
A part, in the case of a case else is is the statement as a whole.
Select * from t where Id = 3 and date 1997
Without the optimiser, It does
Date 1997
Id = 3
Select *
With the optimiser it
As an alternative to CTE/subselect, you could do something like below. Not sure
of the implications on indexing:
--temp table
DECLARE @temp TABLE (
[Value] VARCHAR(15)
)
--populate
INSERT INTO @temp
SELECT '28-Nov-2012' UNION ALL
SELECT '28-Nov-2012' UNION ALL
SELECT 'blah'
SELECT
Hi, I wasn't getting these responses at first so apologies for the delay
in responding.
In between then and now I ended up going with the CASE solution (same as
Les and Thomas, thank you)
I'm going to stick with it but I'm not a huge fan of that as its clearly
then doing unnecessary work by
Hi,
Anyone has a good way of creating manuals/training/user guides?
I've found HTML/Word very cumbersome and more or less useless so I'd like
something better.
There is also a service (www.dozuki.com) that is the basis of iFixIt
website that looks great and they use an open source format called
I haven't tried it yet but we use a suite of tools for acceptance testing
that are capable of automating the user interface and taking screenshots of
various windows when test steps go wrong. I want to write a collection of
Documentation Tests that when run produce a report that shows key
DrExplain
On 30/10/2012 12:41 PM, Corneliu I.
Tusnea wrote:
Hi,
Anyone has a good way of creating manuals/training/user
guides?
I've found HTML/Word very cumbersome and more or less useless
so I'd
11 matches
Mail list logo