d
-
- 1 / 48
-
Flashcards
T-SQL Command: OFFSET
Sets the number of rows to skip before returning the number of rows set using fetch
ORDER BY is required
(...)ORDER BY Name ASC
OFFSET 0 ROWS FETCH NEXT 15 ROWS ONLY
(INNER) JOIN
data from each table when common column appears in both tables
LEFT (OUTER) JOIN
All rows from left table even if joined columns don't match
no matching rows in right table are displayd with null values
RIGHT (OUTER) JOIN
All rows from right table even if joined columns don't match
no matching rows in left table are displayed with null values
FULL (OUTER) JOIN
returns all rows in both tables
none matching rows are shown with NULL values
CROSS JOIN
returns all rows from left table
each row is combined with all rows from right table (Cartesian Products)
Left:10 Rows And Right:10 Rows = 100 Rows (10*10=100)
CTE
Common Table Expression
A temporary result set that is created and available for use within the execution scope of certain T-SQL commands
Advantages of CTEs
- Improved readability and eas in maintenance of complex queries
- the query can be divided into simple separate, logical building blocks
- these blocks can be used to build more complex interim CTEs