There are several reasons:
- You can add calculated columns:
select a, b, a+b FROM table
- You can restrict the transferred data volume.
- You can give individual columns a new name.
- You can program more safely and performant.
Add to the first and second point: Especially usually require column restriction.
Add to the fourth point: When doing adhoc queries I'm almost always using *
. But the programs should always enumerate the columns. This prevents surprising column reordering and also makes it clear what data is actually used.