Here is my query (angelIII helped me)
FROM ( SELECT ID, BegDate, Zip,HP_Type
, ROW_NUMBER() OVER (PARTITION BY ID ORDER BY BegDate ASC) rn
WHERE sq.RN = 1 and HP_Type='SN' and ID =270727
When I run this it does not return any results.
However when I add a space between the '=' and ID for example ID = 270727 it works
I can't understand this. The ID is an Int