Skip to main content

84 docs tagged with "TSQL"

View All Tags

LeetCode 577. Employee Bonus

SQL Solution - The combination of the LEFT JOIN operation and the WHERE conditions ensures that the query retrieves employee names and their corresponding bonus amounts if the bonus is less than 1000 or if no bonus record exists for the employee.

SQL Expand Date Range into Multiple Rows

This T-SQL solution efficiently expands date range into multiple individual rows using recursive Common Table Expressions (CTE). By employing this method, the process of breaking down date range into multiple distinct rows is streamlined, providing a more effective and manageable approach to handling date-related data within the context of a SQL database.

SQL Server: Generate Numbers Table for a Range of Numbers

Microsoft SQL Server TSQL Scripts: Numbers Generator like generate_series in PostgreSQL! Using Recursive CTE or Cross Join SQL techniques to generate a virtual numbers table for any range of number. Print 1 to 100. Print 1 to 1001.