Typical problems
In this chapter we’ll deal with some typical problems often arising in practice and causing certain difficulties in solving. In accordance with our approach, these problems will be solved by single query, i.e. without using of temporary tables and cursors.
Besides, some aspects of language for deeper understanding are repeatedly considered here.
- The number-sequence generation
- Numbering of a query result set
- About the use of the operator CASE
- Once more about NULL values
- Three-valued logic and WHERE clause
- These “sly” outer joins
- About implicit conversion of SQL Server data types
- Random sampling of rows from a table in SQL Server
- Correlated subqueries
- Grouping of time intervals
- Conversion of the date to a string
- Least-square method