In the database I have a number of tables with the same column name. for example Employer.FirstName, Staff.FirstName, Person.firstName etc.
I'm doing a full outer join and want to rename these without specifying the columns.
So it's
What I think I want to do for simplicity is rename everything to tableName_columnName without having to explicitly name each column.
I'm trying to avoid
And before you say it, I know that generally it is a waste of resources to simply say select * since you are returning a lot more than you actually need. The reason for using "select *" is there are a number of user defined columns where the user can name the column whatever they want. Once the application is in place, I don't have anyway of knowing exactly what the users have added for column names.
Is there a way to effectively say "Select employers.* as employers_*"?
To build may have to be the slow laborious task of years. To destroy can simply be the thoughtless act of a single day.
I'm doing a full outer join and want to rename these without specifying the columns.
So it's
Code:
Select employer.*, staff.*, person.* from employer full outer join staff on something full outer join person on something
What I think I want to do for simplicity is rename everything to tableName_columnName without having to explicitly name each column.
I'm trying to avoid
Code:
Select employer.address as Employer_Address,employer.FirstName as Employer_FirstName ...
And before you say it, I know that generally it is a waste of resources to simply say select * since you are returning a lot more than you actually need. The reason for using "select *" is there are a number of user defined columns where the user can name the column whatever they want. Once the application is in place, I don't have anyway of knowing exactly what the users have added for column names.
Is there a way to effectively say "Select employers.* as employers_*"?
To build may have to be the slow laborious task of years. To destroy can simply be the thoughtless act of a single day.