# Itzik Ben-Gan

Itzik
Ben-Gan

Itzik Ben-Gan is a contributing editor to SQL Server Pro and a cofounder of SolidQ. He teaches, lectures, and consults internationally. He's a SQL Server MVP and is the author of several books about T-SQL, including Microsoft SQL Server 2012 High-Performance T-SQL Using Window Functions (Microsoft Press).

Check out Itzik's Puzzled by T-SQL blog.
Twitter: @ItzikBenGan

##### Articles
Itzik discusses two T-SQL challenges: replenishing quantities and depleting quantities. He presents an efficient solution for replenishing quantities and challenges you to find an efficient solution for depleting quantities.
Itzik dives even deeper into the problem of using multiple predicates in your query filters.
Itzik Ben-Gan presents two reader-submitted solutions for identifying a subsequence within a sequence, both of which far surpass his original solutions.
Itzik covers three practical examples affected by the multiple range predicate problem, as well as optimization tips to improve performance.
Multiple range predicates can be the source of query performance problems. Itzik presents some tips for optimizing your solutions.
In Part 2 of this article, Itzik Ben-Gan uses T-SQL to provide the complete solution to an interval packing problem related to drug prescriptions modeled as interval graphs.
Itzik Ben-Gan uses T-SQL to find an efficient solution to an interval packing problem related to drug prescriptions modeled as interval graphs.
Itzik Ben-Gan explores three set-based T-SQL solutions to find the best approach for identifying a subsequence within a sequence.
Itzik Ben-Gan explores several iterative T-SQL solutions to find the best approach for identifying a subsequence within a sequence.
Query plans of T-SQL solutions based on the Decrease and Conquer algorithm contain extra work to deal with Halloween protection. Itzik presents an alternative generic pattern that removes the need for Halloween protection.
Learn how to compute the count of active intervals at the beginning of every fixed interval.
Many types of tasks involve handling date and time intervals and computing related counts. Learn how to compute the maximum count of concurrent sessions during every fixed interval within a certain input period.
Join me for a full-day workshop about T-SQL querying and query tuning improvements in the last major releases of SQL Server (2012, 2008 and 2005).
Itzik presents an improved solution to last month's task using the APPLY operator for computing counts during discrete intervals, as well as a solution for computing counts during discrete intervals including packing logic.
Learn how to identify discrete intervals and counts of overlapping source intervals.

##### Digital Magazine Archives

Browse back issues of SQL Server Pro, from January 2007 through the last issue published in April 2014. Find the back issues here.

Sep 15, 2016
Sponsored

### Power BI Desktop “Publish to Pyramid Server” Button

Many organizations today cannot use public cloud solutions because of security concerns, administrative challenges and functional limitations. However, they still need a centralized platform where end users can conduct self-service analytics in an IT-enabled environment....More
Jul 6, 2016
Sponsored

### Using BI Office Together with Microsoft Power BI Desktop to Unlock Business Insights

It is crucial to move away from data and analytics stored on individual desktop computers. Today’s solutions must promote holistic, collective intelligence. The strong, continued alliance between Microsoft and Pyramid Analytics helps make all this possible....More
Jul 6, 2016
Sponsored

### Why It’s Important to Unlock Business Insights Trapped on Individual Desktops

To become a truly data-driven enterprise, many business leaders recognize that they must extend the capabilities of self-service business intelligence (BI) and analytics to more of their business users. Many BI tools tackle part of this need, but they don’t offer a complete enterprise solution....More
##### Related Sites

Sponsored Introduction Continue on to (or wait seconds) ×