Database Reference
In-Depth Information
Figure 6.48
Use HAVING with GROUP BY.
Figure 6.49
Use scalar function RANK.
and RANK. he RANK function returns the rank for each record in a result set from a query.
For example, Figure 6.49 shows that the classrooms in each building are ranked based on their
capacities. he ranking of capacities is in a descending order per building.
By now, you have learned how to use various built-in functions in query statements. he SQL
Database function library includes many other built-in functions. A complete coverage of the
built-in functions is beyond the scope of this topic. You can ind more information about the
built-in functions through the SQL Database Help menu. Besides these built-in functions, users
can also create user-deined functions. We will discuss user-deined functions in the next chapter.
ACTIVITY 6.1 QUERYING DATA WITH SQL
To query information from the tables, you can either directly log on to the Windows Azure
SQL Database portal at https:// yourserver .database.windows.net or connect the SSMS to
the Windows Azure SQL Database server. Since we are able to access Windows Azure SQL
Search WWH ::




Custom Search