Max Price
Max Price

Reputation: 15

How to rename MySQL query result

How do I rename an output of a query? I have this query:

   select * 
   from (generalprofile left join applicant on applicant.profileID = 
   generalprofile.profileID) as A 
   inner join (generalprofile left join applicant on applicant.profileID = 
   generalprofile.profileID) as B on A.applicationID = B.applicationID ;

and I need to inner join the results of 2 queries. "AS" doesnt seem to work

Upvotes: 0

Views: 609

Answers (1)

ScaisEdge
ScaisEdge

Reputation: 133400

You don't build the select tables in right way
inside the ( ) you must place a valid select .. not only the table name and join

  select * 
   from ( select * form generalprofile 
          left join applicant on applicant.profileID = 
   generalprofile.profileID) A 
   inner join (select * from generalprofile 
          left join applicant on applicant.profileID = 
   generalprofile.profileID) B on A.applicationID = B.applicationID ;

Upvotes: 1

Related Questions