课程: SQL for Testers

今天就学习课程吧!

今天就开通帐号,24,700 门业界名师课程任您挑!

Understanding more complex SQL queries

Understanding more complex SQL queries - SQL教程

课程: SQL for Testers

Understanding more complex SQL queries

- We're going to start looking at how to use SQL to help with testing where shortly. But before we do that, I want to take a few more minutes to get into some of the fundamentals of SQL queries. So far, we've been able to see how to use the select, the from, and the where clauses. Let's look at one more, fairly common clause the order by clause. So we'll add that to our query here, order by, and let's order this by first name, send that query, and you can see that the results that we get back are in alphabetical order for the first name we first got As and Bs and so on. We could also change this. We could order it instead by last name. So let's try that out and see what happens. And you can see that now the first name isn't in alphabetical order, but the last name column is. Or we could order it by vehicle year or whatever we wanted a for columns that we can order by. Now, you might have noticed that the order by clause here is making an assumption. Why did it start with the first…

内容