In a recent labs release a new feature was introduced by Oracle, or actually two very related new features were introduced. The first new feature is Common Table Expressions (CTEs), which is also known as WITH . The second feature is recursive CTEs, also known as WITH RECURSIVE . An example of WITH : WITH non_root_users AS (SELECT User, Host FROM mysql.user WHERE User<>'root') SELECT Host FROM non_root_users WHERE User = ? The non-CTE equivalent is this: SELECT Host FROM (SELECT User, Host FROM mysql.user WHERE User<>'root') non_root_users WHERE User = ? This makes it easier to understand the query, especially if there are many subqueries. Besides using regular subqueries or CTEs you could also put the subquery in a view, but this requires more privileges. It is also difficult to change the views later on as other quieries might have started to use them. But views are still very useful. You can make it easier for others to query data or you can ...