SELECT CategoryID,ProductName,UnitPriceFROM ProductsWHERE CategoryID = 1 OR CategoryID =2 AND UnitPrice < 15
When you run the query above you would expect that all the records retrieved will have a unit price of less than $15 dollar but that is not the case. Below is the result from the query.
As you can see several records have unit price that are greater than $15 dollars
Now let's run the query with parentheses
SELECT CategoryID,ProductName,UnitPriceFROM ProductsWHERE (CategoryID = 1 OR CategoryID =2) AND UnitPrice < 15
Below is the result from the query
Now you are getting result that you've always wanted in the first place. The parentheses tells SQL Server to ignore the order of evaluation and evaluate what is in the parentheses first then evaluate the second part of the WHERE clause.
Similar Posts:
Mua vé máy bay tại Aivivu, tham khảo
ReplyDeleteve may bay di my gia re
giá vé về việt nam
khi nào có máy bay từ nhật về việt nam
vé máy bay từ frankfurt đi hà nội
chuyến bay từ canada về việt nam
mua vé máy bay từ hàn quốc về việt nam
chuyen bay chuyen gia ve viet nam
This way they don't have to spend time opening hundreds of card packs or participating in modes they don't like to complete challenges. The way to get a lot of Coins is also very simple, that is to Buy FUT 22 Coins at UTnice. UTnice supports a variety of secure payment methods, and their website provides Comfort Trade delivery methods, you only need to pay and enter the necessary information correctly. Their delivery team will help you complete the rest.
ReplyDelete
ReplyDeleteHello all
am looking few years that some guys comes into the market
they called themselves hacker, carder or spammer they rip the
peoples with different ways and it’s a badly impact to real hacker
now situation is that peoples doesn’t believe that real hackers and carder scammer exists.
Anyone want to make deal with me any type am available
Available Services
..Wire Bank Transfer all over the world
..Western Union Transfer all over the world
..Credit Cards (USA, UK, AUS, CAN, NZ)
..School Grade upgrade / remove Records
..Spamming Tool
..keyloggers / rats
..Social Media recovery
.. Teaching Hacking / spamming / carding (1/2 hours course)
discount for re-seller
Contact: 24/7
fixitrogers@gmail.com
Python, MySQL Django Training & Certification Course
ReplyDelete