可以就用=,>,<把你的语句贴出来!

解决方案 »

  1.   

    谢谢楼上的兄弟,原 SQL 语句如下,但返回的结果总是 Code = 3049000000
    这一条记录,不知道为什么?
    select top 1 * from Merchandise where TradeCode = 14 and Price >= 100 AND Price <= 1000 and Code > '3049000000' order by Code desc group by Code
      

  2.   

    字符串可以比较大小的,也许是你的字段值有空格 
    '3049000000 '>'3049000000' --前面多一个空格select top 1 * from Merchandise where TradeCode = 14 and Price >= 100 AND Price <= 1000 and RTRIM(Code) > '3049000000'
    试试
      

  3.   

    前面多空格,后面的空格没影响and LTRIM(Code) > '3049000000'
      

  4.   

    可以进行字符串比较,它的比较原理是:   比较第一个字符,如果相同,再比较第二个字符。
       
       我做了一个试验,没有出现你说所的问题:   use pubs
       select * from sales 
       where ord_num > 'P2121'   你再试试。