Let's assume I have a table named Alphabet. Now let's say this table has the following columns:
a, b, c, d, e ..., z
Now I want to select everything from the mentioned table (but select f as aaa), but I don't want to do this:
select a, b, c, d, e, f as aaa, g ..., z
from Alphabet;
Clearly the above is cumbersome if the are a lot of columns. So I am thinking if it is possible to do something like
select f as aaa, *
from Alphabet;
This is probably something there is a lot info about on the net, but I'm not sure what to search for. Has this kind of select got an expression or name? Thanks in advance
You can write this:
select a.f as aaa, a.*
from Alphabet a;
Note that the output set will contain both f
and aaa
. It is unclear whether this is what you want.
To remove f
from the result set, you need to list all the columns that you do want.
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