오브젝트에서는 하위의 여러 개의 항목들을 컬렉션(Collection, List 또는 Array를 말함)으로 표현할 수 있다. 그렇다면, SQL 구문에서는 이 항목들을 어떻게 쿼리할 수 있을까?
이 경우를 위해 %ELEMENT 라는 쿼리 구문이 있다. 아래 SQL 구문을 스터디 해 보기 바란다.
SELECT Name,FavoriteColors
FROM Sample.Person
WHERE FOR SOME %ELEMENT(FavoriteColors) (%VALUE IN ('Red','Blue'))
아래는 위 SQL 구문을 실행한 결과이다.Output of Sample Query:
Name |
FavoriteColors |
Davis,Bart N. |
Red Red |
Ragon,Linda B. |
Blue Blue |
Xenia,Tara X. |
Red Red |
Nagel,Edgar B. |
Black Blue |
Uberoth,Chris S. |
Blue Yellow |
Umansky,Vincent N. |
Red Purple |
Ingleman,Marvin V. |
Yellow Red |
Alton,Violet Y. |
Red |
Gibbs,Elvira L. |
Blue |
Chesire,Mo Q. |
Blue |
Edwards,Chad J. |
Blue Yellow |
Yu,Fred I. |
Blue |
Miller,Juanita X. |
Blue Green |
Murphy,Neil B. |
Blue |
Cooke,Jeff Y. |
Blue Orange |
Tweed,Ted L. |
Blue Black |
Ott,Mo K. |
Purple Red |
Waterman,James F. |
Purple Blue |
Frith,Paul A. |
Red |
Smyth,Pam C. |
Blue |
보다 자세한 내용은 내장된 문서에서 아래 문서를 찾아 보시라.
문서-Caché SQL Reference
|