编写此代码时出错。我该如何解决? 它说错误在'in'
CREATE PROCEDURE spPracticum
(@MaxCountry As VARCHAR,
@MinCountry As VARCHAR)
AS
SELECT
[Country], [Year], [Subscribers], c.[name]
FROM
[dbo].[cell phone subscribers] AS s
JOIN
[dbo].[countries] AS c ON s.[Country] = c.[country-code]
WHERE
@MinCountry <= Country
AND @MaxCountry >= Country IN (SELECT MAX(Subscribers)
FROM [dbo].[cell phone subscribers] )
ORDER BY
Year
答案 0 :(得分:0)
您现在获得的具体错误(我假设为WHERE
是由于 AND @MaxCountry >= Country IN (SELECT MAX(Subscribers)
FROM [dbo].[cell phone subscribers] )
条款的第二部分:
AND @MaxCountry >= Country
这是一个无效的语句 - 您可以使用s.[Country]
仅返回@MaxCountry
值小于或等于IN
参数的提供值的记录,但您不能然后在此末尾添加一个 android:theme="@style/back_button_style
语句,因为它没有意义,SQL也不了解你正在尝试做什么。
我并不完全清楚你 试图做什么,所以我无法提供更多的指导 - 如果你能澄清你的问题给我们基于给定输入的预期和当前输出的一些想法,然后我们可能能够进一步帮助。
尝试阅读How do I ask a good question?中的Help Center文章,或者与How to create a Minimal, Complete, and Verifiable example一起阅读。