title: SQL Multiple Joins
body: <p>Given the following two tables:</p>
  
  <pre><code>CREATE TABLE [dbo].[MTCorrelations]
  (
      [CorrelationID] [int] IDENTITY(1,1) NOT NULL,
      [StockA] [nvarchar](5) NOT NULL,
      [StockB] [nvarchar](5) NOT NULL,
      [Correlation] [float] NOT NULL,
      [LengthStr] [nvarchar](5) NOT NULL,
      [Date] [datetime] NOT NULL
  )
  
  CREATE TABLE [dbo].[Industries]
  (
      [IndustryID] [int] IDENTITY(1,1) NOT NULL,
      [Symbol] [nvarchar](5) NOT NULL,
      [Sector] [nvarchar](50) NULL,
      [Industry] [nvarchar](50) NULL
  )
  </code></pre>
  
  <p>I am trying to look up the industries of StockA and StockB from the Industries table. However I don't know how to do multiple joins. This is the best I can come up with:</p>
  
  <pre><code>SELECT TOP 1000 
  [CorrelationID]
  
        ,[StockA]
        ,[StockB]
        ,[Correlation]
        ,b.Industry
        ,c.Industry
    FROM [MarketTopology].[dbo].[MTCorrelations] as a JOIN [MarketTopology].[dbo].[Industries] as b ON a.StockA = b.Symbol
    AND a JOIN [MarketTopology].[dbo].[Industries] as c ON a.StockB = c.Symbol
  </code></pre>
  
  <p>I get error on the AND. What's the correct way of doing this?</p>