answersLogoWhite

0


Best Answer

It is the same difference between an OR Boolean and AND Boolean. In an OR query, you are looking for something that matches one of several possible values, while in an AND query, you are looking for something that matches all of several possible values.

-- Find the first name of anyone in the USA, or have a last name starting with A.

SELECT FirstName FROM Contacts WHERE Country = 'USA' OR LastName LIKE 'A%'

-- Find the first name of anyone in the USA that also has a last name starting with A

SELECT FirstName FROM Contacts WHERE Country = 'USA' AND LastName LIKE 'A%'

The difference between these two is that the first one will return people outside the USA if their last name starts with an A, while in the second query, only people inside the USA with the last name starting with A will be returned.

AND will always return the same or fewer values than OR.

User Avatar

Wiki User

12y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: What is the difference between an ''or'' query and an ''and'' query?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

What is the difference between query datasheet and a table datasheet?

No


What is the difference between a query and a report?

A query (inquiry) is seeking information. A report provides information.


What is the difference between query and inquiry?

The spelling is different. This is so obvious!


What is the difference between hql and sql?

one of the difference is HQL does not support distinct but SQL supports the distinct in the query


What is the Difference between transaction and query?

The query is simple set of insert,update,delete statement where as transaction is a set of statement which follows ACID properties.


What is the difference between a simple query and a complex query?

A simple search is one based on a single term or criterion.


What is the difference between simple and complex queries?

a simple query is when you answer a database to do something and a complex/parameter query is a prompt to run a question to find something


What is the difference between union and intersect operations in SQL?

* The UNION operator combines the output of two query expressions into a single result set. Query expressions are executed independently, and their output is combined into a single result table. * The EXCEPT operator evaluates the output of two query expressions and returns the difference between the results. The result set contains all rows returned from the first query expression except those rows that are also returned from the second query expression. * The INTERSECT operator evaluates the output of two query expressions and returns only the rows common to each.


What is the difference between SQL2005 and Excel 2007?

SQL is Structured Query Language, and relates to databases. Excel is a spreadsheet application.


Difference between query studio and report studio?

Query studio is a subset (in feature) of Report Studio. It is manily used for Ad-hoc queries. But report studio used for complex and fancy report development.


Difference between SQL and OQL?

in some cease both are the same they use query language but in fact the out puts are very deference


Tell you very clearly what is the difference between sql and mysql?

SQL is a universal query language used to access relational data. MySQL is a database storage engine which utilizes the SQL query language as the means to interface with the data stored.