Select count(*)
from
(
Select name
from
(
Select name,address
from <table_name>
) ANS
OPTION(MAXRECURSION 1)
) a1
执行查询时出错:
关键字&#39; OPTION&#39;
附近的语法不正确
答案 0 :(得分:1)
您需要将OPTION(MAXRECURSION ...)
从子查询移动到主查询的末尾。
Select count(*)
from
(
Select name
from
(
Select name,address
from <table_name>
) ANS
) a1
OPTION(MAXRECURSION 1);