SOME | ANY(SQL Server Compact)

스칼라 값을 단일 열 집합 값과 비교합니다.

구문

scalar_expression { = | < > | ! = | > | > = | ! > | < | < = | ! < } 
   { SOME | ANY } (subquery )

인수

  • scalar_expression
    MicrosoftSQL Server Compact의 모든 유효한 식입니다.

  • { = | <> | != | > | >= | !> | < | <= | !< }
    유효한 비교 연산자입니다.

  • SOME | ANY
    비교를 수행하도록 지정합니다.

  • subquery
    한 열의 결과 집합이 포함된 하위 쿼리입니다. 반환되는 열의 데이터 형식은 scalar_expression의 데이터 형식과 같아야 합니다.

결과 형식

bit

반환 값

ANY 쌍(scalar_expression, x)에 대해 지정된 비교를 수행한 결과가 TRUE이면 SOME이나 ANY에서 TRUE를 반환합니다. 여기서 x는 단일 열 집합에 있는 값입니다. 비교 결과가 FALSE이면 FALSE를 반환합니다.

ONE은 SOME 또는 ANY 인수와 함께 사용할 수 있습니다.

-- This example queries for Employee ID values greater than 13.
-- The query locates some matching values,
-- a result of True is returned, with a list of the
-- matching Employee records.
SELECT *
FROM Employees
WHERE (0 < ANY
      (SELECT [Employee ID]
      FROM Employees AS Employees_1
      WHERE ([Employee ID] > 13)));

-- This example queries for Employee ID values greater than 15.
-- Because no matching values are found, a result of False is
-- returned and no records are displayed.
SELECT *
FROM Employees
WHERE (0 < ANY
      (SELECT [Employee ID]
      FROM Employees AS Employees_1
      WHERE ([Employee ID] > 15)));