Hi,
I had a previous thread where I just couldn't understand how to build a select using unions and joins with sub queries and hoped someone could explain how it works so pehaps I can use this method in the future.
When you have a select with a union, are the columns meant to be the same? the example on w3schools shows the column names selected from two different tables as being the same.
So is UNION the same as adding additional records to the query from a different table where the data structure must be the same.
Where as a JOIN splices two tables together as if all columns were in a single table.
on my other thread i was having problems using a WHERE clause which included columns from the first select and columns from the JOIN nested sub-query as well as couldn't find the right place to put the 'ON' keyword.
So what is the scope for table columns within nested queries UNIONs and JOINs?
Is a query processed from left to right and what makes the right hand side part of the query able to see the left hand side columns?
Is there some presedence and is it based on operator/keyword?
Help understanding this is apprecaited as I just couldn't grasp how to do what i wanted and ended up with in-efficient VBA code to achive my goal.
I'd like to do things better and more efficient if possible.
Many thanks,
1DMF.
"In complete darkness we are all the same, only our knowledge and wisdom separates us, don't let your eyes deceive you."
"If a shortcut was meant to be easy, it wouldn't be a shortcut, it would be the way!"
Google Rank Extractor -> Perl beta with FusionCharts
I had a previous thread where I just couldn't understand how to build a select using unions and joins with sub queries and hoped someone could explain how it works so pehaps I can use this method in the future.
When you have a select with a union, are the columns meant to be the same? the example on w3schools shows the column names selected from two different tables as being the same.
So is UNION the same as adding additional records to the query from a different table where the data structure must be the same.
Where as a JOIN splices two tables together as if all columns were in a single table.
on my other thread i was having problems using a WHERE clause which included columns from the first select and columns from the JOIN nested sub-query as well as couldn't find the right place to put the 'ON' keyword.
So what is the scope for table columns within nested queries UNIONs and JOINs?
Is a query processed from left to right and what makes the right hand side part of the query able to see the left hand side columns?
Is there some presedence and is it based on operator/keyword?
Help understanding this is apprecaited as I just couldn't grasp how to do what i wanted and ended up with in-efficient VBA code to achive my goal.
I'd like to do things better and more efficient if possible.
Many thanks,
1DMF.
"In complete darkness we are all the same, only our knowledge and wisdom separates us, don't let your eyes deceive you."
"If a shortcut was meant to be easy, it wouldn't be a shortcut, it would be the way!"
Google Rank Extractor -> Perl beta with FusionCharts