Reply to Re: Narrowed Down Search

Your name:

Reply:


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

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация