Oracle AI Database 26ai(23.26.4): Mixing SELECT * with Other Columns and Expressions

 Oracle AI Database 26ai(26.23.4) introduces a useful SQL enhancement that allows the * wildcard to be combined with explicit column names, constants, and SQL expressions in the same SELECT list.

Before the 23.26.4 release, Oracle did not allow * to be used alongside other select-list items in this way:

The asterisk cannot be combined with explicit column names in this statement, so the query fails with ORA-00936.

Now, the same query executes successfully on Oracle AI Database 23.26.4:

Oracle expands * into all columns from the PERSON table at its position in the select list. As a result, ID and FNAME appear twice: once through the explicit column references and once through the wildcard expansion.


Additional Examples:

1.Using Multiple Wildcards

Each occurrence of * expands independently, returning the complete set of table columns twice.

2. Combining * with SQL Functions

This makes it possible to retrieve the original table data and additional calculated values in a single query without explicitly listing every column.

3. Combining Constants with *

In this example, Oracle returns two constant expressions followed by all columns from PERSON. The constant values are repeated for every row in the result set.

Vahid Yousefzadeh

Comments

Popular posts from this blog

Oracle 21c Enhancements for TTS Export/Import

Oracle 23ai — error_message_details Parameter for Displaying Error Details

Buffer Busy Wait and Read by Other Session in Oracle