读书人

with nolock的有关问题

发布时间: 2012-08-10 12:19:33 作者: rapoo

with nolock的问题
select t.hi,t.mob,t.hed,t.timefrom ( select convert(varchar(10),convert(int,(convert(float,lon)*10)))+ convert(varchar(10),convert(int,(convert(float,lat)*10))) lonlat, lon,lat,dir,spe,mob,gpstime from Tableabc where time between '2012-7-12 15:04:04' and '2012-7-13 17:04:04' and convert(float,lat)!=0 and convert(float,lon)!=0 ) t left join tabletemp o on t.lonlat=o.lonlat order by t.time

想在这个sql上加with nolock该如何加

[解决办法]

SQL code
--你的语句本身有问题,要想加,加在表后就可以了,如select * from a with (nolock)inner join b with (nolock) on a.id=b.id;
[解决办法]
表名称后面加就可以了
[解决办法]
select t.hi,t.mob,t.hed,t.timefrom ( select convert(varchar(10),convert(int,(convert(float,lon)*10)))+ convert(varchar(10),convert(int,(convert(float,lat)*10))) lonlat, lon,lat,dir,spe,mob,gpstime from Tableabc where time between '2012-7-12 15:04:04' and '2012-7-13 17:04:04' and convert(float,lat)!=0 and convert(float,lon)!=0 ) t with (nolock)left join tabletemp o with (nolock) on t.lonlat=o.lonlat order by t.time


可以资源占用释放
[解决办法]
连接表的后边可以with nolock
[解决办法]
表名后面直接跟,如果有别名,跟在别名后

读书人网 >SQL Server

热点推荐