我的查询出现了什么问题我无法弄清楚。where子句中的select语句sql
Select id, name, description, road_st, sub_area, area, website, email, category,
working_hrs, inside_building, logo, latitude, longitude,
geom.STNumPoints() as vertices,
geom.STAsText() as geom,house_no,building,shop
from Points
where @hr.STIntersects(geog)= 1
and deleted=0
and (select s.name from Sub_Category s where s.id=category)
like '%'[email protected]+'%'
错误:
如果@text='store'
我越来越没有结果......但有一个名为“百货大楼”
查询中SUb_category表中的一行工作正常,直到
Select id, name, description, road_st, sub_area, area, website, email, category,
working_hrs, inside_building, logo, latitude, longitude,
geom.STNumPoints() as vertices,
geom.STAsText() as geom,house_no,building,shop
from Points
where @hr.STIntersects(geog)= 1
and deleted=0
它没有结果,当我添加此行
and (select s.name from Sub_Category s where s.id=category)
like '%'[email protected]+'%'
这条线怎么了?
什么错误得到? – NoobEditor
if @ test =“store” 我没有得到任何结果......但在SUb_category表中有一行名为“Departmental Store” – user3382149
可能是因为你有一个错字??? ,您的查询显示'@ text'和您发布的错误说'@ test' .. :) – NoobEditor