I have a database consisting of header files. E.g:
<ctype.h> etc. When my query is:
select * from hf_list where hf = '<iostream>'
it returns an empty set while
select * from hf_list where hf like '%<iostream>%'"
gets the correct result even though the entry does not have any extra characters other than <iostream>.
Why is this happening?
If you are saying '%%' you are basically saying give me everything checkout below code
;with sam as ( select ' <iostream> ' as col1 union select 'sam' as col1 ) select * from sam where col1 like '%<iostream>%'
If you would like to check if you have blank data do this select * from hf_list where rtrim(ltrim(hf)) = 'iostream'