Changing an app with a JOIN SQL and working with field names

I have several apps that need a new SQL command

For example, say it currently uses a table tblProd which has fields A, B, C

I am changing the SQL command to include a Join such as
tblProd INNER JOIN tblLocation ON tblProd.A = tblLocation.A

This works fine, except the app no longer recognizes the field A, B or C unless they are prefixed with the table name. This creates a lot of work to change all field names.

Anyone have an idea how I can change the SQL without doing a lot of work to the app to change the variable names?

Hi,

You can use alias for each field. Such as:

SELECT
tblProd.field1 AS field1,
tblProd.field2 AS field2,

Brilliant, thank you so very much

1 Like