0

How can I use less than or equal to comparison in this xml varchar(max) element?

select * 
from table 
where SHARED_XML.value('(//ns:Element[@ns:ElementId="29581"]/ns:ElementValue/text())[1]', 'varchar(max)') < '10'
marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
  • 3
    While asking a question, you need to provide a [minimal reproducible example](https://stackoverflow.com/help/minimal-reproducible-example): (1) DDL and sample data population, i.e. CREATE table(s) plus INSERT T-SQL statements. (2) What you need to do, i.e. logic and your code attempt implementation of it in T-SQL. (3) Desired output, based on the sample data in the #1 above. (4) Your SQL Server version (SELECT @@version;). – Yitzhak Khabinsky Aug 29 '22 at 20:39
  • 1
    There are many unknowns in your query: (1) namespace, (2) string comparison could be equal or not equal. – Yitzhak Khabinsky Aug 29 '22 at 20:41

0 Answers0