SQL错误:在预期条件的上下文中指定的非布尔类型的表达式,接近''

时间:2017-07-03 13:12:19

标签: sql sql-server tsql

我是SQL的新手,无法让它发挥作用:

select z.[zip] as [ZIP],
z.[city] as [City],
z.[state] as [State],
z.[county] as [County],
lp.[value] as [Geomarket Short],
lp2.[value] as [Geomarket Long]
from world.dbo.[zip] z
left outer join [lookup.prompt] lp on (lp.[index] = z.[zip]) and (lp.[key] = 
'geomarket_zip')
left outer join [lookup.prompt] lp2 on (lp.[value] = lp2.[index]) and (lp2.
[key] = 'geomarket')
order by z.[zip]

我收到此错误:

  

ORDER BY子句在视图,内联函数,派生表,子查询和公用表表达式中无效,除非还指定了TOP,OFFSET或FOR XML。

当我删除order by子句时,我收到此错误:

  

在预期条件的上下文中指定的非布尔类型的表达式,接近'。'。

1 个答案:

答案 0 :(得分:0)

IEnumerable