I want to select the rows that have a '_' character in a given column from SQL. when I try to run this query, it returns all the rows in the table
SELECT * FROM [Attribute] where LibID=26 and Name like '%_%'
but the following query yields what I need
SELECT * FROM [Attribute] where LibID=26 and CHARINDEX('_', Name) > 0
why my first query is not returning expected result. Maybe I am missing some information/knowledge of SQL.