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?

A query datasheet displays the results of a query operation, showing data based on specified criteria or calculations. A table datasheet displays the data in a table format, representing information stored in a database table. In essence, a query datasheet is derived from a table datasheet and is dynamic based on the query criteria.


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?

A query is a specific request for information or data, usually formal and structured. An inquiry is a broader investigation or exploration into a subject or issue, often with the aim of gaining understanding or knowledge. In general, a query seeks a specific answer, while an inquiry involves a more open-ended search or examination.


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?

In SQL, the UNION operation combines the result sets of two or more queries into a single result set, removing any duplicate rows. The INTERSECT operation returns only the common rows that appear in both result sets of two or more queries.


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.