concept SELECT statement in category sql

This is an excerpt from Manning's book SQL Server MVP Deep Dives.
I’ve never found a set-based approach to finding a “good enough” solution for the bin-packing problem. But I’ve found set-based code that finds the “perfect” solution. This code was originally posted by John Gilson; I’ve corrected and optimized this code and then published it to my blog (http://sqlblog.com/blogs/hugo_kornelis/archive/2008/10/27/bin-packing-part-4-the-set-based-disaster.aspx), but it’s too large to reproduce here. There’s no reason to, either, because this code can never be used in practice—not only because it couples already-bad performance with the ugliest exponential growth curve I’ve ever seen, but also because it requires extra columns in intermediate result sets and many extra lines of code as the bin size and the number of packages increases, such that for real-world problems, you’d need millions of lines of code (and a version of SQL Server that allows more than 4,096 columns per SELECT statement). And then you’ll still get execution times measured in days, if not years.
The most obvious filter in a SELECT statement is the WHERE clause. It filters out the rows that the FROM clause has produced. The database engine controls entirely the order in which the various aspects of a SELECT statement are applied, but logically the WHERE clause is applied after the FROM clause has been completed.