Why is the use of asterisk perfectly valid in oracle sql when the asterisk is by itself in the SELECT clause, but it results in an error when there are other expressions in the SELECT?
For example:
select * from table1 -- is ok
But:
select field, * from table -- is not ok
Oracle only allows a "bare" asterisk when there are no other columns.
Otherwise, you need to qualify it:
select t.field, t.*
from table1 t;
I suspect the reason is that Oracle considers select *
to be a full clause, rather than *
being an abbreviation for all columns.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With