Solved Alias

Space Cowboy

Member
Local time
Today, 08:33
Joined
May 19, 2024
Messages
245
Good Morning Good People,

Can a field name be given an alias in a select statement?
 
Yes - you would write it in the SQL statwment as

Code:
SELECT tb_Customers.Customer_ID AS Customer_Ref_No
FROM tb_Customers;
In the query editor you would do this:
1719907129156.png
 

Attachments

  • 1719907034225.png
    1719907034225.png
    7.8 KB · Views: 24
@Minty's suggestion is correct. However, when using it, you must note the following:
The assigned column alias only has an external effect and partly in the SELECT part of the query.
As a query execution is very different from running through the SQL statement from top to bottom, the column alias is still unknown for operations such as WHERE, GROUP BY, ORDER BY. In these cases, the original expression must be used.
 
I suppose that is why there were errors.
I went back and removed the alias from all statements.

I need to learn what is happening in what order.
 
@ebs17

Danke Eberhard,
Mein Deutsch war noch nie besonders gut, abgesehen von der Analyse guter deutscher Biere ist Doppelbock mein Favorit. Mit Hilfe eines Übersetzers konnte ich Ihren ausführlichen Beitrag lesen. Da sind einige tolle Tipps dabei. Vielen Dank, dass Sie mein Verständnis erweitert haben.
 

Users who are viewing this thread

Back
Top Bottom