From the course: Learning Azure SQL Querying

Unlock the full course today

Join today to access over 24,400 courses taught by industry experts.

Using conditional statements to only get the data you need

Using conditional statements to only get the data you need - Azure Tutorial

From the course: Learning Azure SQL Querying

Using conditional statements to only get the data you need

- [Instructor ] Let's say you need to look up the green helmet by its product number. Change your where clause to say product number equals and within single quotes type HL-U509-G ending single quote in all capital letters and hit run. When you are passing in a string of text you want to surround it with single quotes. Also, if you don't match the case exactly as it's recorded in the field, like if you used a lowercase H instead of a capital H in the product number, the SQL server engine in Azure SQL will still find this record. This might work differently in different database engines, but there are always ways to do case sensitive and case insensitive searches if you need that functionality. If you want to get all the helmets based on their product number, change the equal sign to the keyword like and for the string inside of the single quotes change the G to the percent sign key and click run. The percent sign indicates…

Contents