I had read in this thread below that there is no difference in the data returned in a query where you either have a Where predicate after the join or an 'And':
description of difference between 'where' and 'And' in join
However I do have different row counts in my query, which is using an in-line view query in my overall statement, when I change AND/WHERE. I have noticed that the issue is happening when I use a row number over statement in my in line query.
The reason I am using this is to restrict records in the in line query to only the first date record, so I can return subsequent but related records from the outer query.
However when I change the WHERE to an AND I get different number of rows.
My query is similar to this:
SELECT DISTINCT
      table1.userID,
      table2.UniqueID,
      table3.entrydate,
      table2.entrytime,
      table4.changedatestart,
      table2.changetimestart,
      table5.changedateend,
      table2.changetimeend,
      table6.leavedate,
      table2.leavetime,
      table7.nationality_ID,
      table8.reg_code
      FROM
      table1 INNER JOIN table2 ON (table1.t1_KEY=table2.t2_KEY)
       RIGHT OUTER JOIN DATETIMETABLE  table4 ON (change_start_date_alias.DATEKEY=table2.change_date_start_KEY)
       RIGHT OUTER JOIN DATETIMETABLE  table5 ON (change_end_date_alias.DATEKEY=table2.change_date_end_KEY)
       RIGHT OUTER JOIN DATETIMETABLE  table3 ON (entry_date_alias.DATEKEY=table2.ENTRY_DATE_KEY)
       RIGHT OUTER JOIN DATETIMETABLE  table6 ON (leave_date_alias.DATEKEY=table2.LEAVE_DATE_KEY)
       RIGHT OUTER JOIN table7 ON (table7.nat_KEY=table2.nat_KEY)
       INNER JOIN table8 ON (table8.reg_DEPT_KEY=table2.reg_DEPT_KEY)
       RIGHT OUTER JOIN dbo.table9 ON (table9.leave_KEY=table2.leave_KEY)
    INNER JOIN
        (SELECT 
        table1.userID UID,
        ROW_NUMBER() OVER (PARTITION BY table1.userID ORDER BY table3.entrydate ASC) as Seq,
        table2.UniqueID "Unique_ID",
        table3.entrydate "entry_date",
        table2.entrytime "entry_time",
        table4.changedatestart "change_start_Date",
        table2.changetimestart "change Start Time",
        table5.changedateend "change End Date",
        table2.changetimeend "change End Time",
        table6.leavedate "leave Date",
        table2.leavetime "leave time",
        table7.nationality_ID "Nationality ID",
        table8.reg_code "Registration Code"
        FROM
        table1 INNER JOIN table2 ON (table1.t1_KEY=table2.t2_KEY)
        RIGHT OUTER JOIN DATETIMETABLE  table4 ON (change_start_date_alias.DATEKEY=table2.change_date_start_KEY)
        RIGHT OUTER JOIN DATETIMETABLE  table5 ON (change_end_date_alias.DATEKEY=table2.change_date_end_KEY)
        RIGHT OUTER JOIN DATETIMETABLE  table3 ON (entry_date_alias.DATEKEY=table2.ENTRY_DATE_KEY)
        RIGHT OUTER JOIN DATETIMETABLE  table6 ON (leave_date_alias.DATEKEY=table2.LEAVE_DATE_KEY)
        RIGHT OUTER JOIN table7 ON (table7.nat_KEY=table2.nat_KEY)
        INNER JOIN table8 ON (table8.reg_DEPT_KEY=table2.reg_DEPT_KEY)
        RIGHT OUTER JOIN dbo.table9 ON (table9.leave_KEY=table2.leave_KEY)
        WHERE table3.entrydate  BETWEEN  '20131201'  AND  '20140531'
        AND table8.reg_DESC  In  ( 'Value1','Value2','Value3','Value4','Value5'  )
        AND table9.leave_CODE IN ('11','15','16','22','25','27','54','57','66')
        )b
    ON b.UID = table1.userID
    **AND b.Unique_ID <> table2.UniqueID**
    AND b.Seq = 1
    AND b.[Registration Code] = table8.reg_code << If this line is commented out the same row count is returned whether WHERE/AND is used in not equal to ID statement:
AND/WHERE b.Unique_ID <> table2.UniqueID
But if I reintroduce the last lin and change the WHERE/AND used in the not equal to ID statement it gives slightly more rows when using the AND statement as opposed to the WHERE predicate.
 
     
    