how to – How to Rename Ambiguous Columns in a Cross Join – MYSQL
I have a small database and I’m trying to narrow down a query as shown in pic attached.
I’m doing some renames and cross joins to try and get the answer I want. I want a query that shows the movies that have an actor in common, and the actor in both movies. In this case, the query should return a table with just
- Liam Neeson – Schindler’s List
- Liam Neeson – Rob Roy
Is they any way to get this from the query I have so far? I’ve been having trouble using renamed columns in the where clause, but I was planning on doing something like:
where aid1 = aid2 and movie1 != movie2;