re: SQL 201: All about SQL JOINs VIEW POST

FULL DISCUSSION
 

I have used cross joins when making a calendar [years] cross join [months]

join and table hint would be nice to have a good example of

I know a left loop join can speed up a query if there are good indexes and the table a small. Where if you have a lot of data a left hash join will be better

Other functions that go with joins would be nice to go over also
CTE tables which if needed you can use joins and union all to create a transverse query. This for me came in handy when creating a Bill Of Materials, that had a parent child relationship that then a child could be a parent

Also another great tool is Cross/Outer apply. Like a left/inner join but you filter the table by row. This is nice when you have a header and detail table and you only need the header info but aggregate one or more columns in the details table. Or if you have a table function or that you need to join to this a good way to do that

code of conduct - report abuse