troubleshooting Question

SQL int value in where.

Avatar of Mr_Shaw
Mr_Shaw asked on
Microsoft SQL Server 2005Microsoft SQL Server 2008SQL
16 Comments3 Solutions537 ViewsLast Modified:
Here is my query (angelIII helped me)

 SELECT *
  FROM ( SELECT ID, BegDate, Zip,HP_Type
              , ROW_NUMBER() OVER (PARTITION BY ID ORDER BY BegDate ASC) rn
           FROM [Add]
       ) sq
 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
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 3 Answers and 16 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 3 Answers and 16 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros