我希望获得以g结尾的客户名称,但%g在SQL Server中不起作用

时间:2017-04-02 04:12:03

标签: sql sql-server

select * 
from customer 
where UPPER(cname) LIKE 'J%G';

1 个答案:

答案 0 :(得分:1)

如果您希望以G结尾,请使用此

 select * 
 from customer 
 where UPPER(cname) LIKE '%G';

如果它似乎没有完成试试这个:

 select * 
 from (
   select top 1000 *
   from customer with #nolock
 ) X
 where UPPER(cname) LIKE '%G';