SQLTeam.com | Weblogs | Forums

Is this below query correct for getting data from a particular table filtered with column header

select statecode='XYZ', * from table -> This gives correct result

select * from table where statecode='XYZ' -> This is not giving any result. What is the issue in this?

what are you trying to do? The first one is setting XYZ as a constant for the column stateCode and returning all records from the table. The second is only returning records where the statecode = XYZ.

1 Like