|
Posted by Erland Sommarskog on 05/09/07 22:11
Looch (lucianoj2005@yahoo.com) writes:
> I'm trying to write a query that gets more granular as criteria is
> available. for example:
>
> select name where A is true, B MIGHT be true and C MIGHT be true.
>
> Is that possible? The idea is that the more information available the
> smaller the size of the dataset.
I'm not sure that I understand. SQL Server evaluates the conditions in
the WHERE clause as it sees fit. If the conditions are simple column
conditions, SQL Server is likely to evaluate them at once for the same
row. If the conditions refers to other table, there are more variations.
Maybe you could post a clarifying example by posting CREATE TABLE statements
for your tables and some INSERT statements with sample data and what result
you desire from the sample?
--
Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se
Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx
Navigation:
[Reply to this message]
|